+4
-2
nixos/doc/manual/development/testing-installer.xml
+4
-2
nixos/doc/manual/development/testing-installer.xml
···
+56
-127
nixos/modules/installer/tools/nixos-install.sh
+56
-127
nixos/modules/installer/tools/nixos-install.sh
···············-binary_caches="$(@perl@/bin/perl -I @nix@/lib/perl5/site_perl/*/* -e 'use Nix::Config; Nix::Config::readConfig; print $Nix::Config::config{"binary-caches"};')"-# These get created in nixos-prepare-root as well, but we want to make sure they're here in case we're-# If we asked for a chroot, that means we're not actually installing anything (yeah I was confused too)-# and we just want to run a command in the context of a $mountPoint that we're assuming has already been-# set up by a previous nixos-install invocation. In that case we set up some remaining bind mounts and-for f in /etc/resolv.conf /etc/hosts; do rm -f $mountPoint/$f; [ -f "$f" ] && cp -Lf $f $mountPoint/etc/; done-for f in /etc/passwd /etc/group; do touch $mountPoint/$f; [ -f "$f" ] && mount --rbind -o ro $f $mountPoint/$f; done-nix-build "${extraBuildFlags[@]}" --no-out-link -E "with import <nixpkgs> {}; runCommand \"closure\" { exportReferencesGraph = [ \"x\" (buildEnv { name = \"env\"; paths = [ ($1) stdenv ]; }) ]; } \"cp x \$out\""-# Create a temporary file ending in .closure (so nixos-prepare-root knows to --import it) to transport the store closure-channel_root="$(nix-env -p /nix/var/nix/profiles/per-user/root/channels -q nixos --no-name --out-path 2>/dev/null || echo -n "")"-@prepare_root@/bin/nixos-prepare-root "$mountPoint" "$channel_root" "$system_root" @nixClosure@ "$system_closure" "$channel_closure"+channelPath="$(nix-env -p /nix/var/nix/profiles/per-user/root/channels -q nixos --no-name --out-path 2>/dev/null || echo -n "")"-# nixos-prepare-root doesn't currently do anything with file ownership, so we set it up here instead+# Mark the target as a NixOS installation, otherwise switch-to-configuration will chicken out.+NIXOS_INSTALL_BOOTLOADER=1 nixos-enter --root "$mountPoint" -- /run/current-system/bin/switch-to-configuration boot-if [ -z "$noRootPasswd" ] && chroot $mountPoint [ -x /run/wrappers/bin/passwd ] && [ -t 0 ]; then+nixos-enter --root "$mountPoint" -c '[[ -e /nix/var/nix/profiles/system/sw/bin/passwd ]] && echo "setting root password..." && /nix/var/nix/profiles/system/sw/bin/passwd'
+1
-10
nixos/modules/installer/tools/tools.nix
+1
-10
nixos/modules/installer/tools/tools.nix
···