librewolf: init (#679)

Link: https://github.com/danth/stylix/pull/679

Co-authored-by: Daniel Thwaites <danth@danth.me>
Co-authored-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
awwpotato 2024-12-13 09:16:08 -08:00 committed by GitHub
parent ccee633284
commit a9e3779949
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 34 additions and 0 deletions

View file

@ -1,3 +1,6 @@
# Consider also updating the LibreWolf module when updating this module,
# as they are very similar.
{ config, lib, ... }:
let

31
modules/librewolf/hm.nix Normal file
View file

@ -0,0 +1,31 @@
# This module is a copy of the Firefox module.
{ 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.librewolf = {
enable =
config.lib.stylix.mkEnableTarget "Librewolf" true;
profileNames = lib.mkOption {
description = "The Librewolf profile names to apply styling on.";
type = lib.types.listOf lib.types.str;
default = [ ];
};
};
config = lib.mkIf (config.stylix.enable && config.stylix.targets.librewolf.enable) {
programs.librewolf.profiles = lib.listToAttrs
(map makeProfileSettingsPair config.stylix.targets.librewolf.profileNames);
};
}