Skip to content

Commit

Permalink
Merge remote-tracking branch 'chayleaf/librewolf' into personal
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin-L committed Jul 31, 2024
2 parents 2059128 + a0ba415 commit 68f4688
Showing 1 changed file with 28 additions and 14 deletions.
42 changes: 28 additions & 14 deletions modules/programs/librewolf.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];

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.";
};
imports = [
(mkFirefoxModule {
inherit modulePath;
name = "LibreWolf";
wrappedPackageName = "librewolf";
unwrappedPackageName = "librewolf-unwrapped";
visible = true;

platforms.linux = {
vendorPath = ".librewolf";
configPath = ".librewolf";
};
platforms.darwin = {
vendorPath = "Library/Application Support/LibreWolf";
configPath = "Library/Application Support/LibreWolf";
};
})
];

options.programs.librewolf = {
settings = mkOption {
type = with types; attrsOf (either bool (either int str));
default = { };
Expand All @@ -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.
'';
Expand All @@ -53,7 +66,8 @@ in {

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;
};
};
}

0 comments on commit 68f4688

Please sign in to comment.