2023-12-14 13:15:47 +00:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
profileSettings = {
|
|
|
|
settings = {
|
|
|
|
"font.name.monospace.x-western" = config.stylix.fonts.monospace.name;
|
|
|
|
"font.name.sans-serif.x-western" = config.stylix.fonts.sansSerif.name;
|
|
|
|
"font.name.serif.x-western" = config.stylix.fonts.serif.name;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
makeProfileSettingsPair = profileName:
|
|
|
|
lib.nameValuePair profileName profileSettings;
|
|
|
|
in {
|
|
|
|
options.stylix.targets.firefox = {
|
|
|
|
enable =
|
2024-06-10 09:52:47 +00:00
|
|
|
config.lib.stylix.mkEnableTarget "Firefox" true;
|
2023-12-14 13:15:47 +00:00
|
|
|
|
|
|
|
profileNames = lib.mkOption {
|
|
|
|
description = "The Firefox profile names to apply styling on.";
|
|
|
|
type = lib.types.listOf lib.types.str;
|
|
|
|
default = [ ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-06-10 09:52:47 +00:00
|
|
|
config = lib.mkIf (config.stylix.enable && config.stylix.targets.firefox.enable) {
|
2023-12-14 13:15:47 +00:00
|
|
|
programs.firefox.profiles = lib.listToAttrs
|
|
|
|
(map makeProfileSettingsPair config.stylix.targets.firefox.profileNames);
|
|
|
|
};
|
|
|
|
}
|