mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46: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:
parent
a4c3ce44fc
commit
e9c80e277b
2 changed files with 28 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
gpg-agent-default-homedir = ./default-homedir.nix;
|
gpg-agent-default-homedir = ./default-homedir.nix;
|
||||||
gpg-agent-override-homedir = ./override-homedir.nix;
|
gpg-agent-override-homedir = ./override-homedir.nix;
|
||||||
|
gpg-agent-pinentry-program = ./pinentry-program.nix;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
27
tests/modules/services/gpg-agent/pinentry-program.nix
Normal file
27
tests/modules/services/gpg-agent/pinentry-program.nix
Normal 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"
|
||||||
|
'';
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue