mirror of
https://github.com/danth/stylix
synced 2024-11-10 06:34:15 +00:00
Add Firefox module (#191)
This commit is contained in:
parent
b5ad31b710
commit
41d2185975
1 changed files with 29 additions and 0 deletions
29
modules/firefox/hm.nix
Normal file
29
modules/firefox/hm.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{ 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 =
|
||||
config.lib.stylix.mkEnableTarget "Firefox" config.programs.firefox.enable;
|
||||
|
||||
profileNames = lib.mkOption {
|
||||
description = "The Firefox profile names to apply styling on.";
|
||||
type = lib.types.listOf lib.types.str;
|
||||
default = [ ];
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.stylix.targets.firefox.enable {
|
||||
programs.firefox.profiles = lib.listToAttrs
|
||||
(map makeProfileSettingsPair config.stylix.targets.firefox.profileNames);
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue