mirror of
https://github.com/nix-community/home-manager.git
synced 2025-03-18 14:28:15 +00:00
firefox: Support paths for userChrome & userContent (#3856)
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:
parent
486b066025
commit
04c915bcf1
1 changed files with 12 additions and 4 deletions
|
@ -401,7 +401,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
userChrome = mkOption {
|
userChrome = mkOption {
|
||||||
type = types.lines;
|
type = types.oneOf [ types.lines types.path ];
|
||||||
default = "";
|
default = "";
|
||||||
description = "Custom ${appName} user chrome CSS.";
|
description = "Custom ${appName} user chrome CSS.";
|
||||||
example = ''
|
example = ''
|
||||||
|
@ -420,7 +420,7 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
userContent = mkOption {
|
userContent = mkOption {
|
||||||
type = types.lines;
|
type = types.oneOf [ types.lines types.path ];
|
||||||
default = "";
|
default = "";
|
||||||
description = "Custom ${appName} user content CSS.";
|
description = "Custom ${appName} user content CSS.";
|
||||||
example = ''
|
example = ''
|
||||||
|
@ -868,10 +868,18 @@ 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.preConfig
|
"${profilesPath}/${profile.path}/user.js" = mkIf (profile.preConfig
|
||||||
!= "" || profile.settings != { } || profile.extraConfig != ""
|
!= "" || profile.settings != { } || profile.extraConfig != ""
|
||||||
|
|
Loading…
Add table
Reference in a new issue