3
0
Fork 0
forked from mirrors/nixpkgs

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

This commit is contained in:
Eelco Dolstra 2015-08-05 13:18:31 +02:00
parent 3f1354a3cd
commit 699ba71b50

View file

@ -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 '<nixpkgs/nixos>' -A config.users.mutableUsers)" = true ] && [ -t 0 ] ; then
if [ "$(chroot $mountPoint /run/current-system/sw/bin/sh -l -c "nix-instantiate --eval '<nixpkgs/nixos>' -A config.users.mutableUsers")" = true ] && [ -t 0 ] ; then
echo "setting root password..."
chroot $mountPoint /var/setuid-wrappers/passwd
fi