Skip to content

Commit

Permalink
Add Firefox module (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
DamienCassou authored Dec 14, 2023
1 parent b5ad31b commit 41d2185
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions modules/firefox/hm.nix
Original file line number Diff line number Diff line change
@@ -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);
};
}

0 comments on commit 41d2185

Please sign in to comment.