{config, lib, pkgs, inputs, os, ...} : lib.mkMerge [ (lib.mkIf (os == "linux") { home.file.".librewolf/default/chrome/theme".source = inputs.firefox-gnome-theme; }) (lib.mkIf (os == "darwin") { home.file."/Users/stephans/Library/Application Support/Firefox/Profiles/default/chrome/theme".source = inputs.firefox-macos-theme; }) (let configedFirefox = lib.mkMerge [ (lib.mkIf (os == "darwin") { package = null; }) { enable = true; profiles.default = { isDefault = true; userChrome = if (os == "linux") then '' @import "theme/userChrome.css"; '' else '' @import "theme/chrome/userChrome.css"; @import "theme/custom/singletabhidden.css"; ''; userContent = if (os == "linux") then '' @import "theme/userContent.css"; '' else '' @import "theme/chrome/userContent.css"; ''; settings = { "toolkit.legacyUserProfileCustomizations.stylesheets" = true; # Enable customChrome.cs "browser.uidensity" = 0; # Set UI density to normal "svg.context-properties.content.enabled" = true; # Enable SVG context-propertes "browser.theme.dark-private-windows" = false; # Disable private window dark theme "extensions.autoDisableScopes" = 0; # Auto enable new extentions "browser.toolbars.bookmarks.visibility" = "never"; "gnomeTheme.hideSingleTab" = true; "signon.rememberSignons" = false; "dom.private-attribution.submission.enabled" = false; "app.update.auto" = false; "browser.uiCustomization.state" = ''{"placements":{"widget-overflow-fixed-list":[],"unified-extensions-area":["_testpilot-containers-browser-action","ublock0_raymondhill_net-browser-action","sponsorblocker_ajay_app-browser-action","1b2383b324c8520974ee097e46301d5ca4e076de387c02886f1c6b1503671586_pokeinthe_io-browser-action","gdpr_cavi_au_dk-browser-action","wayback_machine_mozilla_org-browser-action","_cca112bb-1ca6-4593-a2f1-38d808a19dda_-browser-action","jid1-tsgsxbhncspbwq_jetpack-browser-action","firefox_tampermonkey_net-browser-action","_b7f9d2cd-d772-4302-8c3f-eb941af36f76_-browser-action"],"nav-bar":["back-button","forward-button","stop-reload-button","new-tab-button","customizableui-special-spring1","urlbar-container","customizableui-special-spring2","save-to-pocket-button","downloads-button","fxa-toolbar-menu-button","unified-extensions-button","_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action"],"toolbar-menubar":["menubar-items"],"TabsToolbar":["tabbrowser-tabs","alltabs-button"],"vertical-tabs":[],"PersonalToolbar":["import-button","personal-bookmarks"]},"seen":["1b2383b324c8520974ee097e46301d5ca4e076de387c02886f1c6b1503671586_pokeinthe_io-browser-action","gdpr_cavi_au_dk-browser-action","wayback_machine_mozilla_org-browser-action","_cca112bb-1ca6-4593-a2f1-38d808a19dda_-browser-action","_testpilot-containers-browser-action","jid1-tsgsxbhncspbwq_jetpack-browser-action","firefox_tampermonkey_net-browser-action","ublock0_raymondhill_net-browser-action","sponsorblocker_ajay_app-browser-action","_b7f9d2cd-d772-4302-8c3f-eb941af36f76_-browser-action","_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action","developer-button"],"dirtyAreaCache":["unified-extensions-area","nav-bar","vertical-tabs","PersonalToolbar","toolbar-menubar","TabsToolbar"],"currentVersion":20,"newElementCount":3}''; }; extensions = with pkgs.nur.repos.rycee.firefox-addons; [ ublock-origin bitwarden consent-o-matic sponsorblock multi-account-containers privacy-redirect ] ++ (if (os == "darwin") then [ onepassword-password-manager ] else [ wayback-machine h264ify fediact tampermonkey laboratory-by-mozilla ]); search = { default = "DuckDuckGo"; force = true; }; containers = { "Personal" = { color = "green"; icon = "circle"; id = 3; }; "ON2IT" = { color = "orange"; icon = "circle"; id = 1; }; "Lekker van Peet" = { color = "blue"; icon = "circle"; id = 2; }; "Radboud Universiteit" = { color = "red"; icon = "circle"; id = 4; }; "Utrecht University" = { color = "yellow"; icon = "circle"; id = 5; }; }; containersForce = true; }; } ]; in lib.mkMerge [ (lib.mkIf (os == "linux") { programs.librewolf = configedFirefox; }) (lib.mkIf (os == "darwin") { programs.firefox = configedFirefox; }) ]) ]