1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-02 23:21:02 +01:00
home-manager/tests/modules/services/gpg-agent/pinentry-program.nix
Austin Horstman e9c80e277b tests/gpg-agent: add pinentry-program test
Add test that the code works to generate the correct pinentry-program
configuration when supplying both options.
2025-04-29 20:36:45 -05:00

27 lines
602 B
Nix

{
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"
'';
}