fork/home-manager

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

Mario Rodastreewide: fix typos (#3618)c59f0eac

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