mirror of
https://github.com/nix-community/home-manager
synced 2024-12-18 07:49:48 +01:00
gpg-agent: fix SSH support for fish
This commit is contained in:
parent
866a4ddcb3
commit
7026e1a934
1 changed files with 11 additions and 5 deletions
|
@ -9,11 +9,18 @@ let
|
||||||
|
|
||||||
homedir = config.programs.gpg.homedir;
|
homedir = config.programs.gpg.homedir;
|
||||||
|
|
||||||
|
gpgSshSupportStr = ''
|
||||||
|
${gpgPkg}/bin/gpg-connect-agent updatestartuptty /bye > /dev/null
|
||||||
|
'';
|
||||||
|
|
||||||
gpgInitStr = ''
|
gpgInitStr = ''
|
||||||
GPG_TTY="$(tty)"
|
GPG_TTY="$(tty)"
|
||||||
export GPG_TTY
|
export GPG_TTY
|
||||||
'' + optionalString cfg.enableSshSupport
|
'' + optionalString cfg.enableSshSupport gpgSshSupportStr;
|
||||||
"${gpgPkg}/bin/gpg-connect-agent updatestartuptty /bye > /dev/null";
|
|
||||||
|
gpgFishInitStr = ''
|
||||||
|
set -gx GPG_TTY (tty)
|
||||||
|
'' + optionalString cfg.enableSshSupport gpgSshSupportStr;
|
||||||
|
|
||||||
# mimic `gpgconf` output for use in `systemd` unit definitions.
|
# mimic `gpgconf` output for use in `systemd` unit definitions.
|
||||||
# we cannot use `gpgconf` directly because it heavily depends on system
|
# we cannot use `gpgconf` directly because it heavily depends on system
|
||||||
|
@ -238,9 +245,8 @@ in {
|
||||||
|
|
||||||
programs.bash.initExtra = mkIf cfg.enableBashIntegration gpgInitStr;
|
programs.bash.initExtra = mkIf cfg.enableBashIntegration gpgInitStr;
|
||||||
programs.zsh.initExtra = mkIf cfg.enableZshIntegration gpgInitStr;
|
programs.zsh.initExtra = mkIf cfg.enableZshIntegration gpgInitStr;
|
||||||
programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration ''
|
programs.fish.interactiveShellInit =
|
||||||
set -gx GPG_TTY (tty)
|
mkIf cfg.enableFishIntegration gpgFishInitStr;
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
(mkIf (cfg.sshKeys != null) {
|
(mkIf (cfg.sshKeys != null) {
|
||||||
|
|
Loading…
Reference in a new issue