11.stylix/modules/zen-browser/hm.nix
Steinar Darri Þorgilsson 82242e0f9b
zen-browser: replace mustache template with Nix multiline string (#1829)
Link: https://github.com/nix-community/stylix/pull/1829

Reviewed-by: Karun Sandhu <129101708+MrSom3body@users.noreply.github.com>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Reviewed-by: awwpotato <awwpotato@voidq.com>
2025-08-16 23:02:11 +02:00

66 lines
1.7 KiB
Nix

{
mkTarget,
lib,
config,
options,
...
}:
mkTarget {
name = "zen-browser";
humanName = "Zen Browser";
extraOptions = {
profileNames = lib.mkOption {
description = "The Zen Browser profile names to apply styling on.";
type = lib.types.listOf lib.types.str;
default = [ ];
example = [ "default" ];
};
};
configElements =
lib.optionals (builtins.hasAttr "zen-browser" options.programs)
[
(
{ cfg }:
{
warnings =
lib.optional (config.programs.zen-browser.enable && cfg.profileNames == [ ])
''stylix: zen-browser: `config.stylix.targets.zen-browser.profileNames` is not set. Declare profile names with 'config.stylix.targets.zen-browser.profileNames = [ "<PROFILE_NAME>" ];'.'';
}
)
(
{
cfg,
fonts,
}:
{
programs.zen-browser.profiles = lib.genAttrs cfg.profileNames (_: {
settings = {
"font.name.monospace.x-western" = fonts.monospace.name;
"font.name.sans-serif.x-western" = fonts.sansSerif.name;
"font.name.serif.x-western" = fonts.serif.name;
};
});
}
)
(
{
cfg,
colors,
}:
{
programs.zen-browser.profiles = lib.genAttrs cfg.profileNames (_: {
settings = {
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
};
userChrome = import ./userChrome.nix { inherit colors; };
userContent = import ./userContent.nix { inherit colors; };
});
}
)
];
}