fork/home-manager

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

Mario Rodastreewide: fix typos (#3618)c59f0eac

master
2.6 KiB95 linesraw
1{ config, lib, pkgs, ... }:
2
3with lib;
4
5{
6  imports = [ ../../accounts/email-test-accounts.nix ];
7
8  test.asserts.warnings.expected = [
9    "mbsync channels no longer use masterPattern. Use farPattern in its place."
10    "mbsync channels no longer use slavePattern. Use nearPattern in its place."
11  ];
12
13  config = {
14    programs.mbsync = {
15      enable = true;
16      # programs.mbsync.groups and
17      # accounts.email.accounts.<name>.mbsync.groups should NOT be used at the
18      # same time.
19      # If they are, then the new version will take precedence.
20      groups.inboxes = {
21        "hm@example.com" = [ "Inbox1" "Inbox2" ];
22        hm-account = [ "Inbox" ];
23      };
24    };
25
26    accounts.email.accounts = {
27      "hm@example.com".mbsync = {
28        enable = true;
29        groups.inboxes = {
30          channels = {
31            inbox1 = {
32              farPattern = "Inbox1";
33              nearPattern = "Inboxes";
34            };
35            inbox2 = {
36              farPattern = "Inbox2";
37              nearPattern = "Inboxes";
38            };
39          };
40        };
41      };
42
43      hm-account.mbsync = {
44        enable = true;
45        groups.hm-account = {
46          channels.earlierPatternMatch = {
47            farPattern = "Label";
48            nearPattern = "SomethingUnderLabel";
49            patterns = [
50              "ThingUnderLabel"
51              "!NotThisMaildirThough"
52              ''"[Weird] Label?"''
53            ];
54          };
55          channels.inbox = {
56            farPattern = "Inbox";
57            nearPattern = "Inbox";
58          };
59          channels.strangeHostBoxName = {
60            farPattern = "[Weird]/Label Mess";
61            nearPattern = "[AnotherWeird]/Label";
62          };
63          channels.patternMatch = {
64            farPattern = "Label";
65            nearPattern = "SomethingUnderLabel";
66            patterns = [
67              "ThingUnderLabel"
68              "!NotThisMaildirThough"
69              ''"[Weird] Label?"''
70            ];
71          };
72        };
73        # No group should be printed.
74        groups.emptyGroup = { };
75        # Group should be printed, but left with default channels.
76        groups.emptyChannels = {
77          channels.empty1 = { };
78          channels.empty2 = { };
79        };
80      };
81    };
82
83    test.asserts.warnings.expected = [
84      "mbsync channels no longer use masterPattern. use farPattern in its place."
85      "mbsync channels no longer use slavePattern. Use nearPattern in its place."
86    ];
87
88    test.stubs.isync = { };
89
90    nmt.script = ''
91      assertFileExists home-files/.mbsyncrc
92      assertFileContent home-files/.mbsyncrc ${./mbsync-expected.conf}
93    '';
94  };
95}