{ config, pkgs, lib, inputs, ... }: let cfg = config.local.programs.browsers.librewolf; policiesJson = pkgs.callPackage ./policies.nix { firefoxAddons = inputs.firefox-addons.packages."${pkgs.system}"; withRedirectorAddon = true; withSidebarTabsAddon = true; withAllSearchEngines = true; }; finalLibrewolf = cfg.package.override { extraPoliciesFiles = cfg.package.unwrapped.extraPoliciesFiles ++ [ policiesJson ]; }; in { options.local.programs.browsers.librewolf = with lib; { enable = mkEnableOption "librewolf"; package = mkPackageOption pkgs "librewolf" {}; finalPackage = mkOption { type = types.package; readOnly = true; default = finalLibrewolf; }; }; }