fork/home-manager

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

Robert Helgessontests: add option `test.stubs`cb09a968

master
1.4 KiB66 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    nmt.script = ''
56      assertFileExists home-files/.config/neomutt/neomuttrc
57      assertFileExists home-files/.config/neomutt/hm@example.com
58      assertFileContent home-files/.config/neomutt/neomuttrc ${
59        ./neomutt-with-binds-expected.conf
60      }
61      assertFileContent home-files/.config/neomutt/hm@example.com ${
62        ./hm-example.com-expected
63      }
64    '';
65  };
66}