mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-09 18:41:06 +01:00
treewide: flatten single file modules
Some files don't need nesting and can be root level again to reduce conflicts with other PRs. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
parent
bda9deb791
commit
86402a17b6
424 changed files with 15 additions and 15 deletions
78
modules/programs/librewolf.nix
Normal file
78
modules/programs/librewolf.nix
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
{ config, lib, ... }:
|
||||
let
|
||||
|
||||
cfg = config.programs.librewolf;
|
||||
|
||||
mkOverridesFile = prefs: ''
|
||||
// Generated by Home Manager.
|
||||
|
||||
${lib.concatStrings (
|
||||
lib.mapAttrsToList (name: value: ''
|
||||
defaultPref("${name}", ${builtins.toJSON value});
|
||||
'') prefs
|
||||
)}
|
||||
'';
|
||||
|
||||
modulePath = [
|
||||
"programs"
|
||||
"librewolf"
|
||||
];
|
||||
|
||||
mkFirefoxModule = import ./firefox/mkFirefoxModule.nix;
|
||||
|
||||
in
|
||||
{
|
||||
meta.maintainers = with lib.maintainers; [
|
||||
chayleaf
|
||||
onny
|
||||
];
|
||||
|
||||
imports = [
|
||||
(mkFirefoxModule {
|
||||
inherit modulePath;
|
||||
name = "LibreWolf";
|
||||
description = "LibreWolf is a privacy enhanced Firefox fork.";
|
||||
wrappedPackageName = "librewolf";
|
||||
unwrappedPackageName = "librewolf-unwrapped";
|
||||
visible = true;
|
||||
|
||||
platforms.linux = {
|
||||
configPath = ".librewolf";
|
||||
};
|
||||
platforms.darwin = {
|
||||
configPath = "Library/Application Support/LibreWolf";
|
||||
};
|
||||
|
||||
enableBookmarks = false;
|
||||
})
|
||||
];
|
||||
|
||||
options.programs.librewolf = {
|
||||
settings = lib.mkOption {
|
||||
type = with lib.types; attrsOf (either bool (either int str));
|
||||
default = { };
|
||||
example = lib.literalExpression ''
|
||||
{
|
||||
"webgl.disabled" = false;
|
||||
"privacy.resistFingerprinting" = false;
|
||||
}
|
||||
'';
|
||||
description = ''
|
||||
Attribute set of global LibreWolf settings and overrides. Refer to
|
||||
<https://librewolf.net/docs/settings/>
|
||||
for details on supported values.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.file.".librewolf/librewolf.overrides.cfg" = lib.mkIf (cfg.settings != { }) {
|
||||
text = mkOverridesFile cfg.settings;
|
||||
};
|
||||
|
||||
mozilla.librewolfNativeMessagingHosts =
|
||||
cfg.nativeMessagingHosts
|
||||
# package configured native messaging hosts (entire browser actually)
|
||||
++ (lib.optional (cfg.finalPackage != null) cfg.finalPackage);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue