From 18159c85b9733161ead2b8fcbfbc9fefbef9f3c7 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 4 Jan 2018 16:12:06 +0100 Subject: [PATCH] home-environment: deprecate option `home.sessionVariableSetter` --- modules/home-environment.nix | 7 +++-- modules/misc/news.nix | 54 ++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 2 deletions(-) diff --git a/modules/home-environment.nix b/modules/home-environment.nix index 66fe430bc..197e9dc57 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -159,8 +159,8 @@ in }; home.sessionVariableSetter = mkOption { - default = "bash"; - type = types.enum [ "pam" "bash" "zsh" ]; + default = null; + type = types.nullOr (types.enum [ "pam" "bash" "zsh" ]); example = "pam"; description = '' Identifies the module that should set the session variables. @@ -171,6 +171,9 @@ in 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. ''; }; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 8ca9b7aae..5c11803ed 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -478,6 +478,60 @@ in necessary. ''; } + + { + 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}} + ''; + } ]; }; }