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

firefox: Support paths for userChrome & userContent

A path may be preferred for some uses, and allowing it avoids the user
needing to `builtins.readFile`, thus creating duplicates and making it
more difficult to determine the actual store path.
This commit is contained in:
Andrew Marshall 2023-04-07 12:56:00 -04:00
parent afc892db74
commit 64efbca505

View file

@ -397,7 +397,7 @@ in {
}; };
userChrome = mkOption { userChrome = mkOption {
type = types.lines; type = types.oneOf [ types.lines types.path ];
default = ""; default = "";
description = "Custom ${name} user chrome CSS."; description = "Custom ${name} user chrome CSS.";
example = '' example = ''
@ -416,7 +416,7 @@ in {
}; };
userContent = mkOption { userContent = mkOption {
type = types.lines; type = types.oneOf [ types.lines types.path ];
default = ""; default = "";
description = "Custom ${name} user content CSS."; description = "Custom ${name} user content CSS.";
example = '' example = ''
@ -836,10 +836,16 @@ in {
"${profilesPath}/${profile.path}/.keep".text = ""; "${profilesPath}/${profile.path}/.keep".text = "";
"${profilesPath}/${profile.path}/chrome/userChrome.css" = "${profilesPath}/${profile.path}/chrome/userChrome.css" =
mkIf (profile.userChrome != "") { text = profile.userChrome; }; mkIf (profile.userChrome != "") (let
key =
if builtins.isString profile.userChrome then "text" else "source";
in { "${key}" = profile.userChrome; });
"${profilesPath}/${profile.path}/chrome/userContent.css" = "${profilesPath}/${profile.path}/chrome/userContent.css" =
mkIf (profile.userContent != "") { text = profile.userContent; }; mkIf (profile.userContent != "") (let
key =
if builtins.isString profile.userContent then "text" else "source";
in { "${key}" = profile.userContent; });
"${profilesPath}/${profile.path}/user.js" = mkIf (profile.settings != { } "${profilesPath}/${profile.path}/user.js" = mkIf (profile.settings != { }
|| profile.extraConfig != "" || profile.bookmarks != [ ]) { || profile.extraConfig != "" || profile.bookmarks != [ ]) {