From c255e939579383e88da0a477e40aa3b5972db3e7 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Fri, 27 Sep 2024 14:44:48 +0200 Subject: [PATCH] gpg-agent: use gpgconf to launch gpg-agent on macOS The '--supervised' option is deprecated and not supported. Instead, use gpgconf to launch gpg-agent which will use '--daemon' along with '--use-standard-socket' to use the canonical socket paths under $GNUPGHOME. Co-authored-by: Calum MacRae --- modules/services/gpg-agent.nix | 3 ++- tests/modules/services/gpg-agent/expected-agent.plist | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/services/gpg-agent.nix b/modules/services/gpg-agent.nix index 988c009a1..d4b0b8ff0 100644 --- a/modules/services/gpg-agent.nix +++ b/modules/services/gpg-agent.nix @@ -358,7 +358,8 @@ in { enable = true; config = { # macOS doesn't like the "--supervised" option - ProgramArguments = [ "${gpgPkg}/bin/gpgconf" "--launch" "gpg-agent" ] + ProgramArguments = + [ "${gpgPkg}/bin/gpgconf" "--launch" "gpg-agent" ] ++ optionals cfg.verbose [ "--verbose" ]; EnvironmentVariables = { GNUPGHOME = homedir; }; KeepAlive = { diff --git a/tests/modules/services/gpg-agent/expected-agent.plist b/tests/modules/services/gpg-agent/expected-agent.plist index 2a1298d7d..9132c0a45 100644 --- a/tests/modules/services/gpg-agent/expected-agent.plist +++ b/tests/modules/services/gpg-agent/expected-agent.plist @@ -20,8 +20,9 @@ Background ProgramArguments - @gpg@/bin/gpg-agent - --supervised + @gpg@/bin/gpgconf + --launch + gpg-agent RunAtLoad