1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-03-10 02:36:54 +00:00
home-manager/tests/modules/services/gpg-agent/override-homedir.nix

26 lines
768 B
Nix
Raw Normal View History

{ config, pkgs, ... }:
2019-10-25 17:12:40 +02:00
let inherit (pkgs.stdenv) isDarwin;
in {
services.gpg-agent.enable = true;
services.gpg-agent.pinentryPackage = null; # Don't build pinentry package.
programs.gpg = {
enable = true;
homedir = "/path/to/hash";
package = config.lib.test.mkStubPackage { outPath = "@gpg@"; };
2019-10-25 17:12:40 +02:00
};
nmt.script = if isDarwin then ''
serviceFile=LaunchAgents/org.nix-community.home.gpg-agent.plist
assertFileExists "$serviceFile"
assertFileContent "$serviceFile" ${./expected-agent.plist}
'' else ''
in="${config.systemd.user.sockets.gpg-agent.Socket.ListenStream}"
if [[ $in != "%t/gnupg/d.wp4h7ks5zxy4dodqadgpbbpz/S.gpg-agent" ]]
then
echo $in
fail "gpg-agent socket directory is malformed"
fi
'';
2019-10-25 17:12:40 +02:00
}