gpg-agent: fix broken variable reference

This commit is contained in:
Phillip Cloud 2024-03-14 05:01:39 -04:00 committed by Robert Helgesson
parent 1ab3cec3a1
commit 587719494e
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED
2 changed files with 10 additions and 4 deletions

View file

@ -248,7 +248,7 @@ in {
++ optional (cfg.maxCacheTtlSsh != null)
"max-cache-ttl-ssh ${toString cfg.maxCacheTtlSsh}"
++ optional (cfg.pinentryPackage != null)
"pinentry-program ${lib.getExe pinentryPackage}"
"pinentry-program ${lib.getExe cfg.pinentryPackage}"
++ [ cfg.extraConfig ]);
home.sessionVariablesExtra = optionalString cfg.enableSshSupport ''

View file

@ -5,11 +5,14 @@ with lib;
{
config = {
services.gpg-agent.enable = true;
services.gpg-agent.pinentryPackage = null; # Don't build pinentry package.
services.gpg-agent.pinentryPackage = pkgs.pinentry-gnome3;
programs.gpg.enable = true;
test.stubs.gnupg = { };
test.stubs.systemd = { }; # depends on gnupg.override
test.stubs = {
gnupg = { };
systemd = { }; # depends on gnupg.override
pinentry-gnome3 = { };
};
nmt.script = ''
in="${config.systemd.user.sockets.gpg-agent.Socket.ListenStream}"
@ -18,6 +21,9 @@ with lib;
echo $in
fail "gpg-agent socket directory not set to default value"
fi
configFile=home-files/.gnupg/gpg-agent.conf
assertFileRegex $configFile "pinentry-program @pinentry-gnome3@/bin/dummy"
'';
};
}