-
-
Notifications
You must be signed in to change notification settings - Fork 2k
/
Copy paththunderbird.nix
98 lines (81 loc) · 2.63 KB
/
thunderbird.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{ lib, realPkgs, ... }: {
imports = [ ../../accounts/email-test-accounts.nix ];
accounts.email.accounts = {
"[email protected]" = {
thunderbird = {
enable = true;
profiles = [ "first" ];
};
aliases = [ "[email protected]" ];
gpg.key = "ABC";
imap = {
port = 123;
tls.enable = true;
};
smtp.port = 456;
signature = {
text = "signature";
showSignature = "append";
};
};
hm-account = {
thunderbird = {
enable = true;
settings = id: {
"mail.identity.id_${id}.protectSubject" = false;
"mail.identity.id_${id}.autoEncryptDrafts" = false;
};
};
};
};
programs.thunderbird = {
enable = true;
package = realPkgs.thunderbird;
profiles = {
first = {
isDefault = true;
withExternalGnupg = true;
userChrome = ''
* { color: blue !important; }
'';
userContent = ''
* { color: red !important; }
'';
extraConfig = ''
user_pref("mail.html_compose", false);
'';
feedAccounts.rss = { };
};
second.settings = {
"second.setting" = "some-test-setting";
second.nested.evenFurtherNested = [ 1 2 3 ];
};
};
settings = {
"general.useragent.override" = "";
"privacy.donottrackheader.enabled" = true;
};
};
nmt.script = let
isDarwin = realPkgs.stdenv.hostPlatform.isDarwin;
configDir = if isDarwin then "Library/Thunderbird" else ".thunderbird";
profilesDir = if isDarwin then "${configDir}/Profiles" else "${configDir}";
platform = if isDarwin then "darwin" else "linux";
in ''
assertFileExists home-files/${configDir}/profiles.ini
assertFileContent home-files/${configDir}/profiles.ini \
${./thunderbird-expected-profiles-${platform}.ini}
assertFileExists home-files/${profilesDir}/first/user.js
assertFileContent home-files/${profilesDir}/first/user.js \
${./thunderbird-expected-first-${platform}.js}
assertFileExists home-files/${profilesDir}/second/user.js
assertFileContent home-files/${profilesDir}/second/user.js \
${./thunderbird-expected-second-${platform}.js}
assertFileExists home-files/${profilesDir}/first/chrome/userChrome.css
assertFileContent home-files/${profilesDir}/first/chrome/userChrome.css \
<(echo "* { color: blue !important; }")
assertFileExists home-files/${profilesDir}/first/chrome/userContent.css
assertFileContent home-files/${profilesDir}/first/chrome/userContent.css \
<(echo "* { color: red !important; }")
'';
}