1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-24 02:39:48 +01:00

librewolf: use mkFirefoxModule

This commit is contained in:
chayleaf 2024-07-29 17:27:11 +07:00 committed by Robert Helgesson
parent f3a2ff6958
commit 18462998b1
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED

View file

@ -14,20 +14,33 @@ let
'') prefs)}
'';
modulePath = [ "programs" "librewolf" ];
mkFirefoxModule = import ./firefox/mkFirefoxModule.nix;
in {
meta.maintainers = [ maintainers.onny ];
meta.maintainers = [ maintainers.chayleaf maintainers.onny ];
imports = [
(mkFirefoxModule {
inherit modulePath;
name = "LibreWolf";
description = "LibreWolf is a privacy enhanced Firefox fork.";
wrappedPackageName = "librewolf";
unwrappedPackageName = "librewolf-unwrapped";
platforms.linux = {
vendorPath = ".librewolf";
configPath = ".librewolf";
};
platforms.darwin = {
vendorPath = "Library/Application Support/LibreWolf";
configPath = "Library/Application Support/LibreWolf";
};
})
];
options.programs.librewolf = {
enable =
mkEnableOption "Librewolf browser, a privacy enhanced Firefox fork";
package = mkOption {
type = types.package;
default = pkgs.librewolf;
defaultText = literalExpression "pkgs.librewolf";
description = "The LibreWolf package to use.";
};
settings = mkOption {
type = with types; attrsOf (either bool (either int str));
default = { };
@ -38,7 +51,7 @@ in {
}
'';
description = ''
Attribute set of LibreWolf settings and overrides. Refer to
Attribute set of global LibreWolf settings and overrides. Refer to
<https://librewolf.net/docs/settings/>
for details on supported values.
'';
@ -51,9 +64,7 @@ in {
lib.platforms.linux)
];
home.packages = [ cfg.package ];
home.file.".librewolf/librewolf.overrides.cfg".text =
mkOverridesFile cfg.settings;
home.file.".librewolf/librewolf.overrides.cfg" =
lib.mkIf (cfg.settings != { }) { text = mkOverridesFile cfg.settings; };
};
}