mirror of
https://github.com/nix-community/home-manager
synced 2024-11-26 21:19:45 +01:00
gpg-agent: make shell integrations optional (#2927)
In esoteric setups, automatically setting GPG_TTY to current tty is not desired on every shell startup. This change adds configuration options to allow user to disable that if desired.
This commit is contained in:
parent
f8b51be714
commit
df6010551d
1 changed files with 15 additions and 3 deletions
|
@ -197,6 +197,18 @@ in {
|
|||
now.
|
||||
'';
|
||||
};
|
||||
|
||||
enableBashIntegration = mkEnableOption "Bash integration" // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
enableZshIntegration = mkEnableOption "Zsh integration" // {
|
||||
default = true;
|
||||
};
|
||||
|
||||
enableFishIntegration = mkEnableOption "Fish integration" // {
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -224,9 +236,9 @@ in {
|
|||
fi
|
||||
'';
|
||||
|
||||
programs.bash.initExtra = gpgInitStr;
|
||||
programs.zsh.initExtra = gpgInitStr;
|
||||
programs.fish.interactiveShellInit = ''
|
||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration gpgInitStr;
|
||||
programs.zsh.initExtra = mkIf cfg.enableZshIntegration gpgInitStr;
|
||||
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
|
||||
set -gx GPG_TTY (tty)
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue