Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Fix installing the Nixpkgs channel on the installation media

And test that it got installed correctly.

+18 -7
+3 -3
nixos/doc/manual/man-nixos-install.xml
··· 26 <replaceable>root</replaceable> 27 </arg> 28 <arg> 29 - <arg choice='plain'><option>--closure</option></arg> 30 - <replaceable>closure</replaceable> 31 </arg> 32 <arg> 33 <arg choice='plain'><option>--no-channel-copy</option></arg> ··· 118 </varlistentry> 119 120 <varlistentry> 121 - <term><option>--closure</option></term> 122 <listitem> 123 <para>If this option is provided, <command>nixos-install</command> will install the specified closure 124 rather than attempt to build one from <filename>/mnt/etc/nixos/configuration.nix</filename>.</para>
··· 26 <replaceable>root</replaceable> 27 </arg> 28 <arg> 29 + <arg choice='plain'><option>--system</option></arg> 30 + <replaceable>path</replaceable> 31 </arg> 32 <arg> 33 <arg choice='plain'><option>--no-channel-copy</option></arg> ··· 118 </varlistentry> 119 120 <varlistentry> 121 + <term><option>--system</option></term> 122 <listitem> 123 <para>If this option is provided, <command>nixos-install</command> will install the specified closure 124 rather than attempt to build one from <filename>/mnt/etc/nixos/configuration.nix</filename>.</para>
+2 -1
nixos/lib/make-disk-image.nix
··· 181 nix-store --load-db < ${closureInfo}/registration 182 183 echo "running nixos-install..." 184 - nixos-install --root $root --no-bootloader --no-root-passwd --closure ${config.system.build.toplevel} --substituters "" 185 186 echo "copying staging root to image..." 187 cptofs -p ${optionalString (partitionTableType != "none") "-P ${rootPartition}"} -t ${fsType} -i $diskImage $root/* /
··· 181 nix-store --load-db < ${closureInfo}/registration 182 183 echo "running nixos-install..." 184 + nixos-install --root $root --no-bootloader --no-root-passwd \ 185 + --system ${config.system.build.toplevel} --channel ${channelSources} --substituters "" 186 187 echo "copying staging root to image..." 188 cptofs -p ${optionalString (partitionTableType != "none") "-P ${rootPartition}"} -t ${fsType} -i $diskImage $root/* /
+8 -3
nixos/modules/installer/tools/nixos-install.sh
··· 12 extraBuildFlags=() 13 14 mountPoint=/mnt 15 16 while [ "$#" -gt 0 ]; do 17 i="$1"; shift 1 ··· 28 --root) 29 mountPoint="$1"; shift 1 30 ;; 31 - --closure) 32 - # FIXME: --closure is a misnomer 33 system="$1"; shift 1 34 ;; 35 --no-channel-copy) 36 noChannelCopy=1 ··· 104 # Copy the NixOS/Nixpkgs sources to the target as the initial contents 105 # of the NixOS channel. 106 if [[ -z $noChannelCopy ]]; then 107 - channelPath="$(nix-env -p /nix/var/nix/profiles/per-user/root/channels -q nixos --no-name --out-path 2>/dev/null || echo -n "")" 108 if [[ -n $channelPath ]]; then 109 echo "copying channel..." 110 mkdir -p $mountPoint/nix/var/nix/profiles/per-user/root
··· 12 extraBuildFlags=() 13 14 mountPoint=/mnt 15 + channelPath= 16 17 while [ "$#" -gt 0 ]; do 18 i="$1"; shift 1 ··· 29 --root) 30 mountPoint="$1"; shift 1 31 ;; 32 + --system|--closure) 33 system="$1"; shift 1 34 + ;; 35 + --channel) 36 + channelPath="$1"; shift 1 37 ;; 38 --no-channel-copy) 39 noChannelCopy=1 ··· 107 # Copy the NixOS/Nixpkgs sources to the target as the initial contents 108 # of the NixOS channel. 109 if [[ -z $noChannelCopy ]]; then 110 + if [[ -z $channelPath ]]; then 111 + channelPath="$(nix-env -p /nix/var/nix/profiles/per-user/root/channels -q nixos --no-name --out-path 2>/dev/null || echo -n "")" 112 + fi 113 if [[ -n $channelPath ]]; then 114 echo "copying channel..." 115 mkdir -p $mountPoint/nix/var/nix/profiles/per-user/root
+5
nixos/tests/boot.nix
··· 25 $machine->start; 26 $machine->waitForUnit("multi-user.target"); 27 $machine->succeed("nix verify -r --no-trust /run/current-system"); 28 $machine->shutdown; 29 ''; 30 };
··· 25 $machine->start; 26 $machine->waitForUnit("multi-user.target"); 27 $machine->succeed("nix verify -r --no-trust /run/current-system"); 28 + 29 + # Test whether the channel got installed correctly. 30 + $machine->succeed("nix-instantiate --dry-run '<nixpkgs>' -A hello"); 31 + $machine->succeed("nix-env --dry-run -iA nixos.procps"); 32 + 33 $machine->shutdown; 34 ''; 35 };