diff --git a/modules/home-environment.nix b/modules/home-environment.nix index 6c98343d..164d3e9c 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -96,6 +96,18 @@ in { meta.maintainers = [ maintainers.rycee ]; + imports = [ + (mkRemovedOptionModule [ "home" "sessionVariableSetter" ] '' + Session variables are now always set through the shell. This is + done automatically if the shell configuration is managed by Home + Manager. If not, then you must source the + + ~/.nix-profile/etc/profile.d/hm-session-vars.sh + + file yourself. + '') + ]; + options = { home.username = mkOption { type = types.str; @@ -158,25 +170,6 @@ in ''; }; - home.sessionVariableSetter = mkOption { - default = null; - type = types.nullOr (types.enum [ "pam" "bash" "zsh" ]); - example = "pam"; - description = '' - Identifies the module that should set the session variables. - - If "bash" is set then config.bash.enable - must also be enabled. - - If "pam" is set then PAM must be used to set the system - environment. Also mind that typical environment variables - might not be set by the time PAM starts up. - - This option is DEPRECATED, the shell modules are now - automatically setting the session variables when enabled. - ''; - }; - home.packages = mkOption { type = types.listOf types.package; default = []; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 0fffe2ea..fada8e74 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -479,60 +479,6 @@ in ''; } - { - time = "2018-01-08T20:39:56+00:00"; - condition = config.home.sessionVariableSetter != null; - message = - let - opts = { - bash = '' - Instead the 'programs.bash' module will, when enabled, - automatically set session variables. You can safely - remove the 'home.sessionVariableSetter' option from your - configuration. - ''; - - zsh = '' - Instead the 'programs.zsh' module will, when enabled, - automatically set session variables. You can safely - remove the 'home.sessionVariableSetter' option from your - configuration. - ''; - - pam = '' - Unfortunately setting general session variables using - PAM will not be directly supported after this date. The - primary reason for this change is its limited support - for variable expansion. - - To continue setting session variables from the Home - Manager configuration you must either use the - 'programs.bash' or 'programs.zsh' modules or manually - source the session variable file - - $HOME/.nix-profile/etc/profile.d/hm-session-vars.sh - - within your shell configuration, see the README file for - more information. This file requires a Bourne-like shell - such as Bash or Z shell but hopefully other shells - will be supported in the future. - - If you specifically need to set a session variable using - PAM then the new option 'pam.sessionVariables' can be - used. It works much the same as 'home.sessionVariables' - but its attribute values must be valid within the PAM - environment file. - ''; - }; - in - '' - The 'home.sessionVariableSetter' option is now deprecated - and will be removed on February 8, 2018. - - ${opts.${config.home.sessionVariableSetter}} - ''; - } - { time = "2018-01-25T11:35:08+00:00"; condition = options.services.qsyncthingtray.enable.isDefined; diff --git a/modules/misc/pam.nix b/modules/misc/pam.nix index dfeaf2f3..91b75f5b 100644 --- a/modules/misc/pam.nix +++ b/modules/misc/pam.nix @@ -4,11 +4,7 @@ with lib; let - homeCfg = config.home; - - vars = - optionalAttrs (homeCfg.sessionVariableSetter == "pam") homeCfg.sessionVariables - // config.pam.sessionVariables; + vars = config.pam.sessionVariables; in diff --git a/modules/programs/bash.nix b/modules/programs/bash.nix index 115fa7ab..786478c1 100644 --- a/modules/programs/bash.nix +++ b/modules/programs/bash.nix @@ -183,9 +183,7 @@ in home.file.".profile".text = '' # -*- mode: sh -*- - ${optionalString (config.home.sessionVariableSetter != "pam") '' - . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" - ''} + . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ${sessionVarsStr} diff --git a/modules/programs/info.nix b/modules/programs/info.nix index 5884bb19..4f3f1e56 100644 --- a/modules/programs/info.nix +++ b/modules/programs/info.nix @@ -54,13 +54,6 @@ in }; config = mkIf cfg.enable { - assertions = [{ - assertion = config.home.sessionVariableSetter != "pam"; - message = '' - The info module does not work with PAM as a session variable setter. - ''; - }]; - home.sessionVariables.INFOPATH = "${cfg.homeInfoDirLocation}\${INFOPATH:+:}\${INFOPATH}"; diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index a5163d87..8005d69f 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -332,9 +332,7 @@ in ${cfg.initExtra} # Environment variables - ${optionalString (config.home.sessionVariableSetter != "pam") '' - . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" - ''} + . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" ${envVarsStr} # Aliases diff --git a/modules/services/gpg-agent.nix b/modules/services/gpg-agent.nix index dfd4b89c..f193b564 100644 --- a/modules/services/gpg-agent.nix +++ b/modules/services/gpg-agent.nix @@ -89,10 +89,7 @@ in home.sessionVariables = optionalAttrs cfg.enableSshSupport { - SSH_AUTH_SOCK = - if config.home.sessionVariableSetter == "pam" - then "\${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh" - else "$(${pkgs.gnupg}/bin/gpgconf --list-dirs agent-ssh-socket)"; + SSH_AUTH_SOCK = "$(${pkgs.gnupg}/bin/gpgconf --list-dirs agent-ssh-socket)"; }; programs.bash.initExtra = gpgInitStr; diff --git a/modules/xsession.nix b/modules/xsession.nix index 40e52202..3bce4506 100644 --- a/modules/xsession.nix +++ b/modules/xsession.nix @@ -82,8 +82,7 @@ in }; home.file.".xprofile".text = '' - ${optionalString (config.home.sessionVariableSetter != "pam") - ''. "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh"''} + . "$HOME/.nix-profile/etc/profile.d/hm-session-vars.sh" if [[ -e "$HOME/.profile" ]]; then . "$HOME/.profile"