fork/home-manager

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

Alois Wohlschlagerthunderbird: support aliases75b24cc5

master
2.1 KiB83 linesraw
1{
2  imports = [ ../../accounts/email-test-accounts.nix ];
3
4  accounts.email.accounts = {
5    "hm@example.com" = {
6      thunderbird = {
7        enable = true;
8        profiles = [ "first" ];
9      };
10
11      aliases = [ "home-manager@example.com" ];
12
13      gpg.key = "ABC";
14
15      imap = {
16        port = 123;
17        tls.enable = true;
18      };
19      smtp.port = 456;
20    };
21
22    hm-account = {
23      thunderbird = {
24        enable = true;
25        settings = id: {
26          "mail.identity.id_${id}.protectSubject" = false;
27          "mail.identity.id_${id}.autoEncryptDrafts" = false;
28        };
29      };
30    };
31  };
32
33  programs.thunderbird = {
34    enable = true;
35
36    profiles = {
37      first = {
38        isDefault = true;
39        withExternalGnupg = true;
40        userChrome = ''
41          * { color: blue !important; }
42        '';
43        userContent = ''
44          * { color: red !important; }
45        '';
46        extraConfig = ''
47          user_pref("mail.html_compose", false);
48        '';
49      };
50
51      second.settings = { "second.setting" = "some-test-setting"; };
52    };
53
54    settings = {
55      "general.useragent.override" = "";
56      "privacy.donottrackheader.enabled" = true;
57    };
58  };
59
60  test.stubs.thunderbird = { };
61
62  nmt.script = ''
63    assertFileExists home-files/.thunderbird/profiles.ini
64    assertFileContent home-files/.thunderbird/profiles.ini \
65      ${./thunderbird-expected-profiles.ini}
66
67    assertFileExists home-files/.thunderbird/first/user.js
68    assertFileContent home-files/.thunderbird/first/user.js \
69      ${./thunderbird-expected-first.js}
70
71    assertFileExists home-files/.thunderbird/second/user.js
72    assertFileContent home-files/.thunderbird/second/user.js \
73      ${./thunderbird-expected-second.js}
74
75    assertFileExists home-files/.thunderbird/first/chrome/userChrome.css
76    assertFileContent home-files/.thunderbird/first/chrome/userChrome.css \
77      <(echo "* { color: blue !important; }")
78
79    assertFileExists home-files/.thunderbird/first/chrome/userContent.css
80    assertFileContent home-files/.thunderbird/first/chrome/userContent.css \
81      <(echo "* { color: red !important; }")
82  '';
83}