From 691c3c5d7d0b4a18db0ff78b8dd53e703220b2da Mon Sep 17 00:00:00 2001 From: "quentin@aristote.fr" Date: Tue, 13 Oct 2026 11:12:18 +0200 Subject: home: firefox: extensions: declare settings --- .../programs/firefox/extensions/default.nix | 104 +++++++++++++++++++++ .../firefox/extensions/temporary-containers.json | 100 ++++++++++++++++++++ .../programs/firefox/extensions/ublock-origin.json | 39 ++++++++ 3 files changed, 243 insertions(+) create mode 100644 modules/home-manager/personal/programs/firefox/extensions/default.nix create mode 100644 modules/home-manager/personal/programs/firefox/extensions/temporary-containers.json create mode 100644 modules/home-manager/personal/programs/firefox/extensions/ublock-origin.json (limited to 'modules/home-manager/personal/programs/firefox/extensions') diff --git a/modules/home-manager/personal/programs/firefox/extensions/default.nix b/modules/home-manager/personal/programs/firefox/extensions/default.nix new file mode 100644 index 0000000..f30ced8 --- /dev/null +++ b/modules/home-manager/personal/programs/firefox/extensions/default.nix @@ -0,0 +1,104 @@ +{ + config, + lib, + ... +}: +let + extensions = { + canvasblocker = { + id = "CanvasBlocker@kkapsner.de"; + # default settings look fine + }; + + url-in-title-keepass = { + id = "{45cf9154-a39d-4c84-93e7-840362a3d8d0}"; + # no settings + }; + + clearurls = { + id = "{74145f27-f039-47ce-a470-a662b129930a}"; + # default settings are fine and + # contain data that should be updated automatically + }; + + temporary-containers = { + id = "{c607c8df-14a7-4f28-894f-29e8722976af}"; + # exported settings + settings = lib.fromJSON (builtins.readFile ./temporary-containers.json); + }; + + floccus = { + id = "floccus@handmadeideas.org"; + # to replace with hm-managed bookmarks + }; + + darkreader = { + id = "addon@darkreader.org"; + # no settings stored in browser-extension-data/ + }; + + ublock-origin = { + id = "uBlock0@raymondhill.net"; + settings = lib.fromJSON (builtins.readFile ./ublock-origin.json); + }; + + firefox-color = { + id = "FirefoxColor@mozilla.com"; + settings.theme.colors = + let + mkBgColor = lib.mkForce ( + with config.lib.stylix.colors; + { + r = base00-rgb-r; + g = base00-rgb-g; + b = base00-rgb-b; + } + ); + in + { + frame = mkBgColor; + sidebar_border = mkBgColor; + popup_border = mkBgColor; + tab_baground_separator = mkBgColor; + tab_line = mkBgColor; + toolbar_field_border_focus = mkBgColor; + }; + }; + }; +in +{ + programs.firefox = { + policies.ExtensionSettings = { + "*".installation_mode = "blocked"; + } + // lib.mapAttrs' (name: { id, ... }: { + name = id; + value = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/${name}/latest.xpi"; + installation_mode = "force_installed"; + updates_disabled = true; + }; + }) extensions; + + profiles.default.extensions.settings = lib.mapAttrs' ( + _: + { + id, + settings ? { }, + }: + { + name = id; + value = + if settings != { } then + { + force = true; + inherit settings; + } + else + { + force = false; + }; + } + ) extensions; + }; +} diff --git a/modules/home-manager/personal/programs/firefox/extensions/temporary-containers.json b/modules/home-manager/personal/programs/firefox/extensions/temporary-containers.json new file mode 100644 index 0000000..c3b3f5d --- /dev/null +++ b/modules/home-manager/personal/programs/firefox/extensions/temporary-containers.json @@ -0,0 +1,100 @@ +{ + "version": "1.9.2", + "preferences": { + "automaticMode": { + "active": true, + "newTab": "created" + }, + "browserActionPopup": false, + "closeRedirectorTabs": { + "active": true, + "delay": 2000, + "domains": [ + "t.co", + "outgoing.prod.mozaws.net", + "slack-redir.net" + ] + }, + "container": { + "color": "toolbar", + "colorRandom": true, + "colorRandomExcluded": [], + "icon": "fingerprint", + "iconRandom": false, + "iconRandomExcluded": [], + "namePrefix": "tmp", + "numberMode": "keep", + "removal": 0 + }, + "contextMenu": true, + "contextMenuBookmarks": false, + "cookies": { + "domain": {} + }, + "deletesHistory": { + "active": false, + "automaticMode": "never", + "containerAlwaysPerDomain": "never", + "containerIsolation": "never", + "containerMouseClicks": "never", + "containerRemoval": 0, + "contextMenu": false, + "contextMenuBookmarks": false, + "statistics": false + }, + "iconColor": "blue-simple", + "ignoreRequests": [ + "getpocket.com", + "addons.mozilla.org" + ], + "isolation": { + "domain": [], + "global": { + "excluded": {}, + "excludedContainers": [], + "mouseClick": { + "ctrlleft": { + "action": "never", + "container": "default" + }, + "left": { + "action": "never", + "container": "default" + }, + "middle": { + "action": "never", + "container": "default" + } + }, + "navigation": { + "action": "never" + } + }, + "mac": { + "action": "disabled" + }, + "reactivateDelay": 0 + }, + "keyboardShortcuts": { + "AltC": false, + "AltI": false, + "AltN": false, + "AltO": false, + "AltP": false, + "AltShiftC": false, + "AltX": true + }, + "notifications": false, + "pageAction": false, + "replaceTabs": false, + "scripts": { + "active": false, + "domain": {} + }, + "statistics": false, + "ui": { + "expandPreferences": true, + "popupDefaultTab": "isolation-global" + } + } +} diff --git a/modules/home-manager/personal/programs/firefox/extensions/ublock-origin.json b/modules/home-manager/personal/programs/firefox/extensions/ublock-origin.json new file mode 100644 index 0000000..4d3c0f6 --- /dev/null +++ b/modules/home-manager/personal/programs/firefox/extensions/ublock-origin.json @@ -0,0 +1,39 @@ +{ + "version": "1.75.0", + "userSettings": { + "uiTheme": "dark", + "importedLists": [], + "popupPanelSections": 31 + }, + "selectedFilterLists": [ + "user-filters", + "ublock-filters", + "ublock-badware", + "ublock-privacy", + "ublock-quick-fixes", + "ublock-unbreak", + "easylist", + "easyprivacy", + "urlhaus-1", + "plowe-0", + "fanboy-cookiemonster", + "ublock-cookies-easylist", + "ublock-cookies-adguard", + "fanboy-social", + "fanboy-thirdparty_social", + "fanboy-ai-suggestions", + "easylist-chat", + "easylist-notifications", + "easylist-annoyances", + "ublock-annoyances", + "DEU-0" + ], + "hiddenSettings": {}, + "whitelist": [ + "chrome-extension-scheme" + ], + "dynamicFilteringString": "behind-the-scene * * noop\nbehind-the-scene * inline-script noop\nbehind-the-scene * 1p-script noop\nbehind-the-scene * 3p-script noop\nbehind-the-scene * 3p-frame noop\nbehind-the-scene * image noop\nbehind-the-scene * 3p noop", + "urlFilteringString": "", + "hostnameSwitchesString": "no-large-media: behind-the-scene false\nno-csp-reports: * true", + "userFilters": "" +} -- cgit v1.3.1