mirror of
https://github.com/nix-community/home-manager
synced 2024-12-24 02:39:48 +01:00
00efa2d4c2
systemd now depends on `gnupg.override`, so we need a stub for systemd too.
(cherry picked from commit 7ff468105d
)
31 lines
831 B
Nix
31 lines
831 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
{
|
|
programs.gpg = {
|
|
enable = true;
|
|
|
|
publicKeys = [
|
|
{
|
|
source = builtins.toFile "key1" "key1";
|
|
trust = 1;
|
|
}
|
|
{ source = builtins.toFile "key2" "key2"; }
|
|
];
|
|
};
|
|
|
|
test.stubs.gnupg = { };
|
|
test.stubs.systemd = { }; # depends on gnupg.override
|
|
|
|
nmt.script = ''
|
|
assertFileContains activate "export GNUPGHOME='/home/hm-user/.gnupg'"
|
|
|
|
assertFileContains activate "unset GNUPGHOME QUIET_ARG keyId importTrust"
|
|
|
|
assertFileRegex activate \
|
|
'^\$DRY_RUN_CMD @gnupg@/bin/gpg \$QUIET_ARG --import /nix/store/[0-9a-z]*-key1$'
|
|
assertFileRegex activate \
|
|
'^\$DRY_RUN_CMD importTrust "/nix/store/[0-9a-z]*-key1" 1$'
|
|
assertFileRegex activate \
|
|
'^\$DRY_RUN_CMD @gnupg@/bin/gpg \$QUIET_ARG --import /nix/store/[0-9a-z]*-key2$'
|
|
'';
|
|
}
|