From 8ad0e40c2b4d5eeda26397dc6742c366a527985e Mon Sep 17 00:00:00 2001 From: Tobias Happ Date: Wed, 27 Nov 2019 22:21:15 +0100 Subject: [PATCH] Use nix-env to set nix-profile link --- modules/environment/login/login-inner.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/environment/login/login-inner.nix b/modules/environment/login/login-inner.nix index 13c252d..5ba4b6c 100644 --- a/modules/environment/login/login-inner.nix +++ b/modules/environment/login/login-inner.nix @@ -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 ${lib.optionalString config.build.initialBuild '' - # link needed to force nix-env -i to install in the user profile - ${coreutils}/bin/ln --symbolic /nix/var/nix/profiles/per-user/$USER/profile $HOME/.nix-profile + echo "Set default user profile..." + ${nix}/bin/nix-env --switch-profile /nix/var/nix/profiles/per-user/$USER/profile [ "$#" -gt 0 ] || echo "Sourcing Nix environment..." . ${nix}/etc/profile.d/nix.sh