1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-23 11:39: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)}
'';
2024-07-29 12:27:11 +02:00
modulePath = [ "programs" "librewolf" ];
mkFirefoxModule = import ./firefox/mkFirefoxModule.nix;
2022-03-14 12:53:42 +01:00
in {
2024-07-29 12:27:11 +02:00
meta.maintainers = [ maintainers.chayleaf maintainers.onny ];
2022-03-14 12:53:42 +01:00
2024-07-29 12:27:11 +02: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
2024-07-29 12:27:11 +02:00
platforms.linux = {
vendorPath = ".librewolf";
configPath = ".librewolf";
};
platforms.darwin = {
vendorPath = "Library/Application Support/LibreWolf";
configPath = "Library/Application Support/LibreWolf";
};
2024-08-06 03:15:54 +02:00
enableBookmarks = false;
2024-07-29 12:27:11 +02:00
})
];
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 = ''
2024-07-29 12:27:11 +02:00
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)
];
2024-07-29 12:27:11 +02:00
home.file.".librewolf/librewolf.overrides.cfg" =
lib.mkIf (cfg.settings != { }) { text = mkOverridesFile cfg.settings; };
2022-03-14 12:53:42 +01:00
};
}