lol

Revert "treewide: use nativeBuildInputs with runCommand instead of inlining"

authored by

K900 and committed by
GitHub
2d3cf010 d72cf7be

+33 -46
+10 -18
nixos/lib/make-options-doc/default.nix
··· 93 93 in rec { 94 94 inherit optionsNix; 95 95 96 - optionsAsciiDoc = pkgs.runCommand "options.adoc" { 97 - nativeBuildInputs = [ pkgs.python3Minimal ]; 98 - } '' 99 - python ${./generateDoc.py} \ 96 + optionsAsciiDoc = pkgs.runCommand "options.adoc" {} '' 97 + ${pkgs.python3Minimal}/bin/python ${./generateDoc.py} \ 100 98 --format asciidoc \ 101 99 ${optionsJSON}/share/doc/nixos/options.json \ 102 100 > $out 103 101 ''; 104 102 105 - optionsCommonMark = pkgs.runCommand "options.md" { 106 - nativeBuildInputs = [ pkgs.python3Minimal ]; 107 - } '' 108 - python ${./generateDoc.py} \ 103 + optionsCommonMark = pkgs.runCommand "options.md" {} '' 104 + ${pkgs.python3Minimal}/bin/python ${./generateDoc.py} \ 109 105 --format commonmark \ 110 106 ${optionsJSON}/share/doc/nixos/options.json \ 111 107 > $out ··· 157 153 # Convert options.json into an XML file. 158 154 # The actual generation of the xml file is done in nix purely for the convenience 159 155 # of not having to generate the xml some other way 160 - optionsXML = pkgs.runCommand "options.xml" { 161 - nativeBuildInputs = with pkgs; [ nix ]; 162 - } '' 156 + optionsXML = pkgs.runCommand "options.xml" {} '' 163 157 export NIX_STORE_DIR=$TMPDIR/store 164 158 export NIX_STATE_DIR=$TMPDIR/state 165 - nix-instantiate \ 159 + ${pkgs.nix}/bin/nix-instantiate \ 166 160 --eval --xml --strict ${./optionsJSONtoXML.nix} \ 167 161 --argstr file ${optionsJSON}/share/doc/nixos/options.json \ 168 162 > "$out" 169 163 ''; 170 164 171 - optionsDocBook = pkgs.runCommand "options-docbook.xml" { 172 - nativeBuildInputs = with pkgs; [ libxslt.bin libxslt.bin python3Minimal ]; 173 - } '' 165 + optionsDocBook = pkgs.runCommand "options-docbook.xml" {} '' 174 166 optionsXML=${optionsXML} 175 167 if grep /nixpkgs/nixos/modules $optionsXML; then 176 168 echo "The manual appears to depend on the location of Nixpkgs, which is bad" ··· 180 172 exit 1 181 173 fi 182 174 183 - python ${./sortXML.py} $optionsXML sorted.xml 184 - xsltproc \ 175 + ${pkgs.python3Minimal}/bin/python ${./sortXML.py} $optionsXML sorted.xml 176 + ${pkgs.libxslt.bin}/bin/xsltproc \ 185 177 --stringparam documentType '${documentType}' \ 186 178 --stringparam revision '${revision}' \ 187 179 --stringparam variablelistId '${variablelistId}' \ 188 180 --stringparam optionIdPrefix '${optionIdPrefix}' \ 189 181 -o intermediate.xml ${./options-to-docbook.xsl} sorted.xml 190 - xsltproc \ 182 + ${pkgs.libxslt.bin}/bin/xsltproc \ 191 183 -o "$out" ${./postprocess-option-descriptions.xsl} intermediate.xml 192 184 ''; 193 185 }
+2 -3
nixos/modules/installer/tools/nixos-build-vms/build-vms.nix
··· 18 18 interactiveDriver = (testing.makeTest { inherit nodes; name = "network"; testScript = "start_all(); join_all();"; }).test.driverInteractive; 19 19 in 20 20 21 - pkgs.runCommandLocal "nixos-build-vms" { 22 - nativeBuildInputs = [ pkgs.makeWrapper ]; 23 - } '' 21 + 22 + pkgs.runCommand "nixos-build-vms" { nativeBuildInputs = [ pkgs.makeWrapper ]; } '' 24 23 mkdir -p $out/bin 25 24 ln -s ${interactiveDriver}/bin/nixos-test-driver $out/bin/nixos-test-driver 26 25 ln -s ${interactiveDriver}/bin/nixos-test-driver $out/bin/nixos-run-vms
+1 -2
nixos/modules/misc/documentation.nix
··· 77 77 pkgsLibPath = filter (pkgs.path + "/pkgs/pkgs-lib"); 78 78 nixosPath = filter (pkgs.path + "/nixos"); 79 79 modules = map (p: ''"${removePrefix "${modulesPath}/" (toString p)}"'') docModules.lazy; 80 - nativeBuildInputs = with pkgs; [ nix ]; 81 80 } '' 82 81 export NIX_STORE_DIR=$TMPDIR/store 83 82 export NIX_STATE_DIR=$TMPDIR/state 84 - nix-instantiate \ 83 + ${pkgs.buildPackages.nix}/bin/nix-instantiate \ 85 84 --show-trace \ 86 85 --eval --json --strict \ 87 86 --argstr libPath "$libPath" \
+8 -8
nixos/modules/virtualisation/brightbox-image.nix
··· 27 27 popd 28 28 ''; 29 29 diskImageBase = "nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.raw"; 30 - nativeBuildInputs = with pkgs; [ e2fsprogs parted ]; 31 - buildInputs = with pkgs; [ util-linux perl ]; 32 - exportReferencesGraph = [ "closure" config.system.build.toplevel ]; 30 + buildInputs = [ pkgs.util-linux pkgs.perl ]; 31 + exportReferencesGraph = 32 + [ "closure" config.system.build.toplevel ]; 33 33 } 34 34 '' 35 35 # Create partition table 36 - parted --script /dev/vda mklabel msdos 37 - parted --script /dev/vda mkpart primary ext4 1 ${diskSize} 38 - parted --script /dev/vda print 36 + ${pkgs.parted}/sbin/parted --script /dev/vda mklabel msdos 37 + ${pkgs.parted}/sbin/parted --script /dev/vda mkpart primary ext4 1 ${diskSize} 38 + ${pkgs.parted}/sbin/parted --script /dev/vda print 39 39 . /sys/class/block/vda1/uevent 40 40 mknod /dev/vda1 b $MAJOR $MINOR 41 41 42 42 # Create an empty filesystem and mount it. 43 - mkfs.ext4 -L nixos /dev/vda1 44 - tune2fs -c 0 -i 0 /dev/vda1 43 + ${pkgs.e2fsprogs}/sbin/mkfs.ext4 -L nixos /dev/vda1 44 + ${pkgs.e2fsprogs}/sbin/tune2fs -c 0 -i 0 /dev/vda1 45 45 46 46 mkdir /mnt 47 47 mount /dev/vda1 /mnt
+9 -10
nixos/modules/virtualisation/qemu-vm.nix
··· 218 218 chmod 0644 $efiVars 219 219 '' else ""} 220 220 ''; 221 - nativeBuildInputs = with pkgs; [ dosfstools gptfdisk kmod mtools ]; 222 - buildInputs = with pkgs; [ util-linux ]; 221 + buildInputs = [ pkgs.util-linux ]; 223 222 QEMU_OPTS = "-nographic -serial stdio -monitor none" 224 223 + lib.optionalString cfg.useEFIBoot ( 225 224 " -drive if=pflash,format=raw,unit=0,readonly=on,file=${cfg.efi.firmware}" ··· 227 226 } 228 227 '' 229 228 # Create a /boot EFI partition with 60M and arbitrary but fixed GUIDs for reproducibility 230 - sgdisk \ 229 + ${pkgs.gptfdisk}/bin/sgdisk \ 231 230 --set-alignment=1 --new=1:34:2047 --change-name=1:BIOSBootPartition --typecode=1:ef02 \ 232 231 --set-alignment=512 --largest-new=2 --change-name=2:EFISystem --typecode=2:ef00 \ 233 232 --attributes=1:set:1 \ ··· 250 249 '' 251 250 } 252 251 253 - mkfs.fat -F16 /dev/vda2 252 + ${pkgs.dosfstools}/bin/mkfs.fat -F16 /dev/vda2 254 253 export MTOOLS_SKIP_CHECK=1 255 - mlabel -i /dev/vda2 ::boot 254 + ${pkgs.mtools}/bin/mlabel -i /dev/vda2 ::boot 256 255 257 256 # Mount /boot; load necessary modules first. 258 - insmod ${pkgs.linux}/lib/modules/*/kernel/fs/nls/nls_cp437.ko.xz || true 259 - insmod ${pkgs.linux}/lib/modules/*/kernel/fs/nls/nls_iso8859-1.ko.xz || true 260 - insmod ${pkgs.linux}/lib/modules/*/kernel/fs/fat/fat.ko.xz || true 261 - insmod ${pkgs.linux}/lib/modules/*/kernel/fs/fat/vfat.ko.xz || true 262 - insmod ${pkgs.linux}/lib/modules/*/kernel/fs/efivarfs/efivarfs.ko.xz || true 257 + ${pkgs.kmod}/bin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/nls/nls_cp437.ko.xz || true 258 + ${pkgs.kmod}/bin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/nls/nls_iso8859-1.ko.xz || true 259 + ${pkgs.kmod}/bin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/fat/fat.ko.xz || true 260 + ${pkgs.kmod}/bin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/fat/vfat.ko.xz || true 261 + ${pkgs.kmod}/bin/insmod ${pkgs.linux}/lib/modules/*/kernel/fs/efivarfs/efivarfs.ko.xz || true 263 262 mkdir /boot 264 263 mount /dev/vda2 /boot 265 264
+3 -5
nixos/tests/step-ca.nix
··· 1 1 import ./make-test-python.nix ({ pkgs, ... }: 2 2 let 3 - test-certificates = pkgs.runCommandLocal "test-certificates" { 4 - nativeBuildInputs = with pkgs; [ step-cli ]; 5 - } '' 3 + test-certificates = pkgs.runCommandLocal "test-certificates" { } '' 6 4 mkdir -p $out 7 5 echo insecure-root-password > $out/root-password-file 8 6 echo insecure-intermediate-password > $out/intermediate-password-file 9 - step certificate create "Example Root CA" $out/root_ca.crt $out/root_ca.key --password-file=$out/root-password-file --profile root-ca 10 - step certificate create "Example Intermediate CA 1" $out/intermediate_ca.crt $out/intermediate_ca.key --password-file=$out/intermediate-password-file --ca-password-file=$out/root-password-file --profile intermediate-ca --ca $out/root_ca.crt --ca-key $out/root_ca.key 7 + ${pkgs.step-cli}/bin/step certificate create "Example Root CA" $out/root_ca.crt $out/root_ca.key --password-file=$out/root-password-file --profile root-ca 8 + ${pkgs.step-cli}/bin/step certificate create "Example Intermediate CA 1" $out/intermediate_ca.crt $out/intermediate_ca.key --password-file=$out/intermediate-password-file --ca-password-file=$out/root-password-file --profile intermediate-ca --ca $out/root_ca.crt --ca-key $out/root_ca.key 11 9 ''; 12 10 in 13 11 {