1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-20 01:59:45 +01:00

thunderbird: add userChrome and userContent options

Add an option to the Thunderbird module that allows specifying CSS for
userChrome and userContent styling

PR #3808
This commit is contained in:
Matthew_Cash 2023-03-25 13:57:47 -07:00 committed by Robert Helgesson
parent 6e57fc4705
commit 28698126bd
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
2 changed files with 42 additions and 0 deletions

View file

@ -157,6 +157,28 @@ in {
example = true; example = true;
description = "Allow using external GPG keys with GPGME."; description = "Allow using external GPG keys with GPGME.";
}; };
userChrome = mkOption {
type = types.lines;
default = "";
description = "Custom Thunderbird user chrome CSS.";
example = ''
/* Hide tab bar in Thunderbird */
#tabs-toolbar {
visibility: collapse !important;
}
'';
};
userContent = mkOption {
type = types.lines;
default = "";
description = "Custom Thunderbird user content CSS.";
example = ''
/* Hide scrollbar on Thunderbird pages */
*{scrollbar-width:none !important}
'';
};
}; };
})); }));
}; };
@ -276,6 +298,12 @@ in {
"${thunderbirdConfigPath}/profiles.ini" = "${thunderbirdConfigPath}/profiles.ini" =
mkIf (cfg.profiles != { }) { text = generators.toINI { } profilesIni; }; mkIf (cfg.profiles != { }) { text = generators.toINI { } profilesIni; };
}] ++ flip mapAttrsToList cfg.profiles (name: profile: { }] ++ flip mapAttrsToList cfg.profiles (name: profile: {
"${thunderbirdProfilesPath}/${name}/chrome/userChrome.css" =
mkIf (profile.userChrome != "") { text = profile.userChrome; };
"${thunderbirdProfilesPath}/${name}/chrome/userContent.css" =
mkIf (profile.userContent != "") { text = profile.userContent; };
"${thunderbirdProfilesPath}/${name}/user.js" = let "${thunderbirdProfilesPath}/${name}/user.js" = let
accounts = filter (a: accounts = filter (a:
a.thunderbird.profiles == [ ] a.thunderbird.profiles == [ ]

View file

@ -35,6 +35,12 @@
first = { first = {
isDefault = true; isDefault = true;
withExternalGnupg = true; withExternalGnupg = true;
userChrome = ''
* { color: blue !important; }
'';
userContent = ''
* { color: red !important; }
'';
}; };
second.settings = { "second.setting" = "some-test-setting"; }; second.settings = { "second.setting" = "some-test-setting"; };
@ -60,5 +66,13 @@
assertFileExists home-files/.thunderbird/second/user.js assertFileExists home-files/.thunderbird/second/user.js
assertFileContent home-files/.thunderbird/second/user.js \ assertFileContent home-files/.thunderbird/second/user.js \
${./thunderbird-expected-second.js} ${./thunderbird-expected-second.js}
assertFileExists home-files/.thunderbird/first/chrome/userChrome.css
assertFileContent home-files/.thunderbird/first/chrome/userChrome.css \
<(echo "* { color: blue !important; }")
assertFileExists home-files/.thunderbird/first/chrome/userContent.css
assertFileContent home-files/.thunderbird/first/chrome/userContent.css \
<(echo "* { color: red !important; }")
''; '';
} }