diff options
author | Silvan Mosberger <infinisil@icloud.com> | 2019-03-08 01:46:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-08 01:46:34 +0100 |
commit | 782cc919c8cdf089bf6db5d5bc6d6209327086dd (patch) | |
tree | 91416c1c7fa019aec07b14b26e7fe4ccc11cf56c | |
parent | 9c88a4162ac03fc7da6cf39b03481545d8bb77e6 (diff) | |
parent | ddabdc0a1ed0f93bd09a98bf6e8a54d97994720b (diff) |
Merge pull request #56254 from shosti/gnupg-ssh-austh-sock
nixos/gnupg: set SSH_AUTH_SOCK in non-interactive settings
-rw-r--r-- | nixos/modules/programs/gnupg.nix | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/nixos/modules/programs/gnupg.nix b/nixos/modules/programs/gnupg.nix index b01de9efaa5e..22521280e936 100644 --- a/nixos/modules/programs/gnupg.nix +++ b/nixos/modules/programs/gnupg.nix @@ -85,11 +85,13 @@ in # SSH agent protocol doesn't support changing TTYs, so bind the agent # to every new TTY. ${pkgs.gnupg}/bin/gpg-connect-agent --quiet updatestartuptty /bye > /dev/null + ''); + environment.extraInit = mkIf cfg.agent.enableSSHSupport '' if [ -z "$SSH_AUTH_SOCK" ]; then export SSH_AUTH_SOCK=$(${pkgs.gnupg}/bin/gpgconf --list-dirs agent-ssh-socket) fi - ''); + ''; assertions = [ { assertion = cfg.agent.enableSSHSupport -> !config.programs.ssh.startAgent; |