1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-12-05 01:19:46 +01:00
home-manager/modules/programs/librewolf.nix

73 lines
1.8 KiB
Nix
Raw Normal View History

2022-03-14 12:53:42 +01:00
{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.librewolf;
mkOverridesFile = prefs: ''
// Generated by Home Manager.
${concatStrings (mapAttrsToList (name: value: ''
defaultPref("${name}", ${builtins.toJSON value});
'') prefs)}
'';
modulePath = [ "programs" "librewolf" ];
mkFirefoxModule = import ./firefox/mkFirefoxModule.nix;
2022-03-14 12:53:42 +01:00
in {
meta.maintainers = [ maintainers.chayleaf maintainers.onny ];
2022-03-14 12:53:42 +01:00
imports = [
(mkFirefoxModule {
inherit modulePath;
name = "LibreWolf";
description = "LibreWolf is a privacy enhanced Firefox fork.";
wrappedPackageName = "librewolf";
unwrappedPackageName = "librewolf-unwrapped";
2022-03-14 12:53:42 +01:00
platforms.linux = {
vendorPath = ".librewolf";
configPath = ".librewolf";
};
platforms.darwin = {
vendorPath = "Library/Application Support/LibreWolf";
configPath = "Library/Application Support/LibreWolf";
};
enableBookmarks = false;
})
];
options.programs.librewolf = {
2022-03-14 12:53:42 +01:00
settings = mkOption {
type = with types; attrsOf (either bool (either int str));
default = { };
example = literalExpression ''
{
"webgl.disabled" = false;
"privacy.resistFingerprinting" = false;
}
'';
description = ''
Attribute set of global LibreWolf settings and overrides. Refer to
<https://librewolf.net/docs/settings/>
2022-03-14 12:53:42 +01:00
for details on supported values.
'';
};
};
config = mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "programs.librewolf" pkgs
lib.platforms.linux)
];
home.file.".librewolf/librewolf.overrides.cfg" =
lib.mkIf (cfg.settings != { }) { text = mkOverridesFile cfg.settings; };
2022-03-14 12:53:42 +01:00
};
}