2019-08-20 10:30:13 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
programs.gpg = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
publicKeys = [
|
|
|
|
{
|
|
|
|
source = builtins.toFile "key1" "key1";
|
|
|
|
trust = 1;
|
|
|
|
}
|
|
|
|
{ source = builtins.toFile "key2" "key2"; }
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
test.stubs.gnupg = { };
|
2023-02-19 11:19:00 +01:00
|
|
|
test.stubs.systemd = { }; # depends on gnupg.override
|
2019-08-20 10:30:13 +02:00
|
|
|
|
|
|
|
nmt.script = ''
|
|
|
|
assertFileContains activate "export GNUPGHOME='/home/hm-user/.gnupg'"
|
|
|
|
|
|
|
|
assertFileContains activate "unset GNUPGHOME QUIET_ARG keyId importTrust"
|
|
|
|
|
|
|
|
assertFileRegex activate \
|
2024-01-13 23:15:00 +01:00
|
|
|
'^run @gnupg@/bin/gpg \$QUIET_ARG --import /nix/store/[0-9a-z]*-key1$'
|
2019-08-20 10:30:13 +02:00
|
|
|
assertFileRegex activate \
|
2024-01-13 23:15:00 +01:00
|
|
|
'^run importTrust "/nix/store/[0-9a-z]*-key1" 1$'
|
2019-08-20 10:30:13 +02:00
|
|
|
assertFileRegex activate \
|
2024-01-13 23:15:00 +01:00
|
|
|
'^run @gnupg@/bin/gpg \$QUIET_ARG --import /nix/store/[0-9a-z]*-key2$'
|
2019-08-20 10:30:13 +02:00
|
|
|
'';
|
|
|
|
}
|