mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
ea1794a798
PR #810
30 lines
775 B
Nix
30 lines
775 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 = { };
|
|
|
|
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$'
|
|
'';
|
|
}
|