Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/services/gpg-agent.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''
Expand Down
12 changes: 9 additions & 3 deletions tests/modules/services/gpg-agent/default-homedir.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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"
'';
};
}