Check hm-session-vars only if home-manager is enabled

This commit is contained in:
Tobias Happ 2019-11-30 22:05:33 +01:00 committed by Alexander Sosedkin
parent c16fab55c0
commit 0b49d57487

View file

@ -61,11 +61,13 @@ writeText "login-inner" ''
[ "$#" -gt 0 ] || echo "Sourcing Nix environment..."
. $HOME/.nix-profile/etc/profile.d/nix.sh
${lib.optionalString (config.home-manager.config != null) ''
if [ -e "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ]; then
[ "$#" -gt 0 ] || echo "Sourcing home-manager environment..."
export NIX_PATH=$HOME/.nix-defexpr/channels''${NIX_PATH:+:}$NIX_PATH
. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"
fi
''}
# Workaround for https://github.com/NixOS/nix/issues/1865
export NIX_PATH=nixpkgs=$HOME/.nix-defexpr/channels/nixpkgs/:$NIX_PATH