fork/home-manager

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

Robert Helgessontests: add option `test.stubs`cb09a968

master
1.6 KiB70 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5{
6  imports = [ ../../accounts/email-test-accounts.nix ];
7
8  config = {
9    accounts.email.accounts = {
10      "hm@example.com" = {
11        notmuch.enable = true;
12        neomutt = {
13          enable = true;
14          extraConfig = ''
15            color status cyan default
16          '';
17        };
18        imap.port = 993;
19      };
20    };
21
22    programs.neomutt = {
23      enable = true;
24      vimKeys = false;
25
26      binds = [
27        {
28          action = "complete-query";
29          key = "<Tab>";
30          map = "editor";
31        }
32        {
33          action = "sidebar-prev";
34          key = "\\Cp";
35          map = [ "index" "pager" ];
36        }
37      ];
38
39      macros = [
40        {
41          action = "<save-message>?<tab>";
42          key = "s";
43          map = "index";
44        }
45        {
46          action = "<change-folder>?<change-dir><home>^K=<enter><tab>";
47          key = "c";
48          map = [ "index" "pager" ];
49        }
50      ];
51    };
52
53    test.stubs.neomutt = { };
54
55    test.asserts.warnings.expected = [
56      "Specifying 'programs.neomutt.(binds|macros).map' as a string is deprecated, use a list of strings instead. See https://github.com/nix-community/home-manager/pull/1885."
57    ];
58
59    nmt.script = ''
60      assertFileExists home-files/.config/neomutt/neomuttrc
61      assertFileExists home-files/.config/neomutt/hm@example.com
62      assertFileContent home-files/.config/neomutt/neomuttrc ${
63        ./neomutt-with-binds-expected.conf
64      }
65      assertFileContent home-files/.config/neomutt/hm@example.com ${
66        ./hm-example.com-expected
67      }
68    '';
69  };
70}