mirror of
https://github.com/nix-community/home-manager.git
synced 2024-12-14 11:57:55 +00:00
Remove deprecated option home.sessionVariableSetter
This commit is contained in:
parent
1bc59f7290
commit
9ea353569a
8 changed files with 17 additions and 97 deletions
|
@ -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.
|
||||
</para><para>
|
||||
If "bash" is set then <varname>config.bash.enable</varname>
|
||||
must also be enabled.
|
||||
</para><para>
|
||||
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.
|
||||
</para><para>
|
||||
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 = [];
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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}
|
||||
|
||||
|
|
|
@ -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}";
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue