fork/home-manager

git clone https://git.julia.blue/fork/home-manager

Naïm Faviertests: fix gnupg stub (#3685)5ffb0f1f

master
831 B31 linesraw
1{ config, lib, pkgs, ... }:
2
3{
4  programs.gpg = {
5    enable = true;
6
7    publicKeys = [
8      {
9        source = builtins.toFile "key1" "key1";
10        trust = 1;
11      }
12      { source = builtins.toFile "key2" "key2"; }
13    ];
14  };
15
16  test.stubs.gnupg = { };
17  test.stubs.systemd = { }; # depends on gnupg.override
18
19  nmt.script = ''
20    assertFileContains activate "export GNUPGHOME='/home/hm-user/.gnupg'"
21
22    assertFileContains activate "unset GNUPGHOME QUIET_ARG keyId importTrust"
23
24    assertFileRegex activate \
25      '^\$DRY_RUN_CMD @gnupg@/bin/gpg \$QUIET_ARG --import /nix/store/[0-9a-z]*-key1$'
26    assertFileRegex activate \
27      '^\$DRY_RUN_CMD importTrust "/nix/store/[0-9a-z]*-key1" 1$'
28    assertFileRegex activate \
29      '^\$DRY_RUN_CMD @gnupg@/bin/gpg \$QUIET_ARG --import /nix/store/[0-9a-z]*-key2$'
30  '';
31}