mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-02 23:21:02 +01:00
Add test that the code works to generate the correct pinentry-program configuration when supplying both options.
27 lines
602 B
Nix
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"
|
|
'';
|
|
}
|