mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-11 17:39:37 +08: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:
@@ -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)
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user