1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-14 11:57:55 +00:00

librewolf: add module

This commit is contained in:
Jonas Heinrich 2022-03-14 12:53:42 +01:00 committed by Robert Helgesson
parent 66d7007e43
commit 2c94b9801f
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
4 changed files with 70 additions and 0 deletions

2
.github/CODEOWNERS vendored
View file

@ -148,6 +148,8 @@ Makefile @thiagokokada
/modules/programs/lf.nix @owm111
/tests/modules/programs/lf @owm111
/modules/programs/librewolf.nix @onny
/modules/programs/lieer.nix @tadfisher
/modules/programs/lsd.nix @marsam

View file

@ -597,6 +597,14 @@ in
migrate the blur settings to use 'services.picom.settings' instead.
'';
}
{
time = "2022-07-13T13:28:54+00:00";
condition = hostPlatform.isLinux;
message = ''
A new module is available: 'programs.librewolf'.
'';
}
];
};
}

View file

@ -98,6 +98,7 @@ let
./programs/less.nix
./programs/lesspipe.nix
./programs/lf.nix
./programs/librewolf.nix
./programs/lieer.nix
./programs/lsd.nix
./programs/man.nix

View file

@ -0,0 +1,59 @@
{ 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)}
'';
in {
meta.maintainers = [ maintainers.onny ];
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 LibeWolf package to use.";
};
settings = mkOption {
type = with types; attrsOf (either bool (either int str));
default = { };
example = literalExpression ''
{
"webgl.disabled" = false;
"privacy.resistFingerprinting" = false;
}
'';
description = ''
Attribute set of LibreWolf settings and overrides. Refer to
<link xlink:href="https://librewolf.net/docs/settings/"/>
for details on supported values.
'';
};
};
config = mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "programs.librewolf" pkgs
lib.platforms.linux)
];
home.packages = [ cfg.package ];
home.file.".librewolf/librewolf.overrides.cfg".text =
mkOverridesFile cfg.settings;
};
}