From 803abb58f9fbebf05a8cf62f960a32fb1b101011 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 4 Jan 2018 13:29:45 +0100 Subject: [PATCH] bash: source session variables script This replaces the explicit set within the Bash profile file. --- modules/programs/bash.nix | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/modules/programs/bash.nix b/modules/programs/bash.nix index fa32a4be7..b5ac9417b 100644 --- a/modules/programs/bash.nix +++ b/modules/programs/bash.nix @@ -131,16 +131,7 @@ in map (v: "shopt -s ${v}") cfg.shellOptions ); - # If Bash is the session variable setter then this is the - # attribute set of global session variables, otherwise it is an - # empty set. - globalEnvVars = - optionalAttrs - (config.home.sessionVariableSetter == "bash") - config.home.sessionVariables; - - envVarsStr = - config.lib.shell.exportAll (cfg.sessionVariables // globalEnvVars); + sessionVarsStr = config.lib.shell.exportAll cfg.sessionVariables; historyControlStr = concatStringsSep "\n" (mapAttrsToList (n: v: "${n}=${v}") ( @@ -185,7 +176,11 @@ in home.file.".profile".text = '' # -*- mode: sh -*- - ${envVarsStr} + ${optionalString (config.home.sessionVariableSetter != "pam") '' + . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" + ''} + + ${sessionVarsStr} ${cfg.profileExtra} '';