Use nix-env to set nix-profile link

This commit is contained in:
Tobias Happ 2019-11-27 22:21:15 +01:00 committed by Alexander Sosedkin
parent b52091eff6
commit 8ad0e40c2b

View file

@ -21,8 +21,8 @@ writeText "login-inner" ''
export GC_NPROCS=1 # to prevent gc warnings of nix, see https://github.com/NixOS/nix/issues/3237 export GC_NPROCS=1 # to prevent gc warnings of nix, see https://github.com/NixOS/nix/issues/3237
${lib.optionalString config.build.initialBuild '' ${lib.optionalString config.build.initialBuild ''
# link needed to force nix-env -i to install in the user profile echo "Set default user profile..."
${coreutils}/bin/ln --symbolic /nix/var/nix/profiles/per-user/$USER/profile $HOME/.nix-profile ${nix}/bin/nix-env --switch-profile /nix/var/nix/profiles/per-user/$USER/profile
[ "$#" -gt 0 ] || echo "Sourcing Nix environment..." [ "$#" -gt 0 ] || echo "Sourcing Nix environment..."
. ${nix}/etc/profile.d/nix.sh . ${nix}/etc/profile.d/nix.sh