nixos-install: Source the profile when running inside the chroot

+1 -7
+1 -7
nixos/modules/installer/tools/nixos-install.sh
··· 256 256 chroot $mountPoint /nix/var/nix/profiles/system/activate 257 257 258 258 259 - # Some systems may not be prepared to use NixOS' paths. 260 - export PATH=/run/current-system/sw/bin:/run/current-system/sw/sbin:$PATH 261 - export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs 262 - export NIX_PATH=$NIX_PATH:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels 263 - 264 - 265 259 # Ask the user to set a root password. 266 - if [ "$(chroot $mountPoint nix-instantiate --eval '<nixpkgs/nixos>' -A config.users.mutableUsers)" = true ] && [ -t 0 ] ; then 260 + if [ "$(chroot $mountPoint /run/current-system/sw/bin/sh -l -c "nix-instantiate --eval '<nixpkgs/nixos>' -A config.users.mutableUsers")" = true ] && [ -t 0 ] ; then 267 261 echo "setting root password..." 268 262 chroot $mountPoint /var/setuid-wrappers/passwd 269 263 fi