From 26342588ab99fdc10bbcc06da18cd331018e2fd5 Mon Sep 17 00:00:00 2001 From: Tad Fisher Date: Sat, 18 Aug 2018 11:57:09 -0700 Subject: [PATCH] gpg-agent: add extraConfig option --- modules/misc/news.nix | 11 +++++++++++ modules/services/gpg-agent.nix | 15 +++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 6ba574b53..1f6bbcc26 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -739,6 +739,17 @@ in A new module is available: 'programs.fish'. ''; } + + { + time = "2018-08-18T19:03:42+00:00"; + condition = config.services.gpg-agent.enable; + message = '' + A new option is available: 'services.gpg-agent.extraConfig'. + + Extra lines may be appended to $HOME/.gnupg/gpg-agent.conf + using this option. + ''; + } ]; }; } diff --git a/modules/services/gpg-agent.nix b/modules/services/gpg-agent.nix index 5e2a41388..c4c045e50 100644 --- a/modules/services/gpg-agent.nix +++ b/modules/services/gpg-agent.nix @@ -108,6 +108,19 @@ in setting to gpg-agent. ''; }; + + extraConfig = mkOption { + type = types.lines; + default = ""; + example = '' + allow-emacs-pinentry + allow-loopback-pinentry + ''; + description = '' + Extra configuration lines to append to the gpg-agent + configuration file. + ''; + }; }; }; @@ -131,6 +144,8 @@ in ++ optional (cfg.maxCacheTtlSsh != null) "max-cache-ttl-ssh ${toString cfg.maxCacheTtlSsh}" + ++ + [ cfg.extraConfig ] ); home.sessionVariables =