From 8ea644997f7d92cac129ddbfab14b33997038dae Mon Sep 17 00:00:00 2001 From: David McFarland Date: Thu, 15 Jun 2023 10:17:43 -0300 Subject: [PATCH] nixos/gpg-agent: move pinentry-program to /etc/gnupg/gpg-agent.conf --- nixos/modules/programs/gnupg.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nixos/modules/programs/gnupg.nix b/nixos/modules/programs/gnupg.nix index 0ca159bdad0c..cc82849003fc 100644 --- a/nixos/modules/programs/gnupg.nix +++ b/nixos/modules/programs/gnupg.nix @@ -93,6 +93,10 @@ in }; config = mkIf cfg.agent.enable { + environment.etc."gnupg/gpg-agent.conf".text = '' + pinentry-program ${pkgs.pinentry.${cfg.agent.pinentryFlavor}}/bin/pinentry + ''; + # This overrides the systemd user unit shipped with the gnupg package systemd.user.services.gpg-agent = mkIf (cfg.agent.pinentryFlavor != null) { unitConfig = { @@ -101,10 +105,7 @@ in Requires = [ "gpg-agent.socket" ]; }; serviceConfig = { - ExecStart = '' - ${cfg.package}/bin/gpg-agent --supervised \ - --pinentry-program ${pkgs.pinentry.${cfg.agent.pinentryFlavor}}/bin/pinentry - ''; + ExecStart = "${cfg.package}/bin/gpg-agent --supervised"; ExecReload = "${cfg.package}/bin/gpgconf --reload gpg-agent"; }; };