From 699ba71b50e9fcdfffcfdb17abee7abba778cc2d Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 5 Aug 2015 13:18:31 +0200 Subject: [PATCH] nixos-install: Source the profile when running inside the chroot --- nixos/modules/installer/tools/nixos-install.sh | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/nixos/modules/installer/tools/nixos-install.sh b/nixos/modules/installer/tools/nixos-install.sh index b1f4772d5705..f7fe6245d6d9 100644 --- a/nixos/modules/installer/tools/nixos-install.sh +++ b/nixos/modules/installer/tools/nixos-install.sh @@ -256,14 +256,8 @@ NIXOS_INSTALL_GRUB=1 chroot $mountPoint \ chroot $mountPoint /nix/var/nix/profiles/system/activate -# Some systems may not be prepared to use NixOS' paths. -export PATH=/run/current-system/sw/bin:/run/current-system/sw/sbin:$PATH -export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos:nixpkgs=/etc/nixos/nixpkgs -export NIX_PATH=$NIX_PATH:nixos-config=/etc/nixos/configuration.nix:/nix/var/nix/profiles/per-user/root/channels - - # Ask the user to set a root password. -if [ "$(chroot $mountPoint nix-instantiate --eval '' -A config.users.mutableUsers)" = true ] && [ -t 0 ] ; then +if [ "$(chroot $mountPoint /run/current-system/sw/bin/sh -l -c "nix-instantiate --eval '' -A config.users.mutableUsers")" = true ] && [ -t 0 ] ; then echo "setting root password..." chroot $mountPoint /var/setuid-wrappers/passwd fi