feat(librewolf): expose package as an overridable option

Move librewolf out of the bare package list into its own module declaring
`local.librewolf.package` (default pkgs.librewolf), mirroring texlive. Lets a
consumer swap the wrapped package — extraPolicies/extraPrefs — to share
extensions and an about:config baseline across profiles without editing the
module.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-10 12:19:40 +02:00
parent 3e093b02d1
commit 8f9eff1640
2 changed files with 38 additions and 2 deletions
+3 -2
View File
@@ -71,7 +71,7 @@ let
''; '';
in in
{ {
imports = [ ./gpg.nix ./media.nix ./texlive.nix ]; imports = [ ./gpg.nix ./media.nix ./texlive.nix ./librewolf.nix ];
# Put ~/.local/bin (the XDG user-bin dir) on PATH so hand-dropped scripts run # Put ~/.local/bin (the XDG user-bin dir) on PATH so hand-dropped scripts run
# by name without wiring each through nix. # by name without wiring each through nix.
@@ -119,7 +119,8 @@ in
xdg.enable = true; xdg.enable = true;
home.packages = with pkgs; [ home.packages = with pkgs; [
librewolf # librewolf is installed by ./librewolf.nix (via local.librewolf.package) so
# the wrapped package stays overridable — do NOT also list it here.
keepassxc # config in ~/.config/keepassxc keepassxc # config in ~/.config/keepassxc
papirus-icon-theme # fuzzel icon-theme; ships non-symbolic power icons papirus-icon-theme # fuzzel icon-theme; ships non-symbolic power icons
# (Adwaita only has them as symbolic, which fuzzel skips) # (Adwaita only has them as symbolic, which fuzzel skips)
+35
View File
@@ -0,0 +1,35 @@
# LibreWolf browser. The package is an option so a consumer can swap the wrapped
# package without editing this module: the base is plain pkgs.librewolf, but the
# wrapper (wrapFirefox) accepts `extraPolicies` and `extraPrefs`, and overriding
# those is the clean way to manage LibreWolf declaratively.
#
# The useful case is sharing state across LibreWolf profiles that otherwise stay
# separate (each `-P <name>` has its own history/logins/cookies). Enterprise
# policy `ExtensionSettings` force- or normal-installs the same add-ons into
# every profile, and `extraPrefs` (autoconfig `defaultPref`/`lockPref`) seeds a
# shared about:config baseline — both applied per-launch, neither touching
# per-profile user data. Override, e.g.:
#
# local.librewolf.package = pkgs.librewolf.override {
# extraPolicies.ExtensionSettings."uBlock0@raymondhill.net" = {
# installation_mode = "normal_installed";
# install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
# };
# extraPrefs = ''defaultPref("browser.startup.page", 3);'';
# };
{ config, lib, pkgs, ... }:
{
options.local.librewolf.package = lib.mkOption {
type = lib.types.package;
default = pkgs.librewolf;
defaultText = lib.literalExpression "pkgs.librewolf";
description = ''
LibreWolf package. Override with
`pkgs.librewolf.override { extraPolicies = ; extraPrefs = ; }`
to share extensions/settings across profiles.
'';
};
config.home.packages = [ config.local.librewolf.package ];
}