1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00

tests/gpg-agent: add pinentry-program test

Add test that the code works to generate the correct pinentry-program
configuration when supplying both options.
This commit is contained in:
Austin Horstman 2025-04-23 14:07:19 -05:00
parent a4c3ce44fc
commit e9c80e277b
2 changed files with 28 additions and 0 deletions

View file

@ -1,4 +1,5 @@
{
gpg-agent-default-homedir = ./default-homedir.nix;
gpg-agent-override-homedir = ./override-homedir.nix;
gpg-agent-pinentry-program = ./pinentry-program.nix;
}

View file

@ -0,0 +1,27 @@
{
config,
lib,
pkgs,
...
}:
lib.mkIf pkgs.stdenv.isLinux {
services.gpg-agent.enable = true;
services.gpg-agent.pinentry = {
package = pkgs.pinentry-all;
program = "pinentry-qt";
};
programs.gpg.enable = true;
nmt.script = ''
in="${config.systemd.user.sockets.gpg-agent.Socket.ListenStream}"
if [[ $in != "%t/gnupg/S.gpg-agent" ]]
then
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-all@/bin/pinentry-qt"
'';
}