{pkgs, ...}: { programs = { chromium = { enable = true; package = pkgs.ungoogled-chromium; commandLineArgs = ["--enable-features=TouchpadOverscrollHistoryNavigation"]; }; firefox = { enable = true; policies = { enable = true; ExtensionSettings = { # Allow extensions to be installed from anywhere "*" = { "installation_mode" = "allowed"; }; # uBlock Origin "uBlock0@raymondhill.net" = { "installation_mode" = "force_installed"; "install_url" = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; }; # LocalCDN "{b86e4813-687a-43e6-ab65-0bde4ab75758}" = { "installation_mode" = "force_installed"; "install_url" = "https://addons.mozilla.org/firefox/downloads/latest/localcdn-fork-of-decentraleyes/latest.xpi"; }; # Sidebery "{3c078156-979c-498b-8990-85f7987dd929}" = { "installation_mode" = "force_installed"; "install_url" = "https://addons.mozilla.org/firefox/downloads/latest/sidebery/latest.xpi"; }; # User-Agent Switcher and Manager "{a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7}" = { "installation_mode" = "force_installed"; "install_url" = "https://addons.mozilla.org/firefox/downloads/latest/user-agent-switcher-and-manager/latest.xpi"; }; }; Preferences = { # This is a sample Nix GPO file generated from Betterfox preferences # SECTION: FASTFOX # GENERAL "content.notify.interval" = 100000; # GFX "gfx.canvas.accelerated.cache-items" = 4096; "gfx.canvas.accelerated.cache-size" = 512; "gfx.content.skia-font-cache-size" = 20; # DISK CACHE "browser.cache.jsbc_compression_level" = 3; # MEDIA CACHE "media.memory_cache_max_size" = 65536; "media.cache_readahead_limit" = 7200; "media.cache_resume_threshold" = 3600; # IMAGE CACHE "image.mem.decode_bytes_at_a_time" = 32768; # NETWORK "network.buffer.cache.size" = 262144; "network.buffer.cache.count" = 128; "network.http.max-connections" = 1800; "network.http.max-persistent-connections-per-server" = 10; "network.http.max-urgent-start-excessive-connections-per-host" = 5; "network.http.pacing.requests.enabled" = false; "network.dnsCacheExpiration" = 3600; "network.dns.max_high_priority_threads" = 8; "network.ssl_tokens_cache_capacity" = 10240; # SPECULATIVE LOADING "network.dns.disablePrefetch" = true; "network.prefetch-next" = false; "network.predictor.enabled" = false; # EXPERIMENTAL "layout.css.grid-template-masonry-value.enabled" = true; "dom.enable_web_task_scheduling" = true; "layout.css.has-selector.enabled" = true; "dom.security.sanitizer.enabled" = true; # SECTION: SECUREFOX # TRACKING PROTECTION "browser.contentblocking.category" = "strict"; "urlclassifier.trackingSkipURLs" = "*.reddit.com, *.twitter.com, *.twimg.com, *.tiktok.com"; "urlclassifier.features.socialtracking.skipURLs" = "*.instagram.com, *.twitter.com, *.twimg.com"; "network.cookie.sameSite.noneRequiresSecure" = true; "browser.download.start_downloads_in_tmp_dir" = true; "browser.helperApps.deleteTempFileOnExit" = true; "browser.uitour.enabled" = false; "privacy.globalprivacycontrol.enabled" = true; "privacy.globalprivacycontrol.functionality.enabled" = true; # OCSP & CERTS / HPKP "security.OCSP.enabled" = 0; "security.remote_settings.crlite_filters.enabled" = true; "security.pki.crlite_mode" = 2; # SSL / TLS "security.ssl.treat_unsafe_negotiation_as_broken" = true; "browser.xul.error_pages.expert_bad_cert" = true; "security.tls.enable_0rtt_data" = false; # DISK AVOIDANCE "browser.privatebrowsing.forceMediaMemoryCache" = true; "browser.sessionstore.interval" = 60000; # SHUTDOWN & SANITIZING "privacy.history.custom" = true; # SEARCH / URL BAR "browser.search.separatePrivateDefault.ui.enabled" = true; "browser.urlbar.update2.engineAliasRefresh" = true; "browser.search.suggest.enabled" = false; "browser.urlbar.suggest.quicksuggest.sponsored" = false; "browser.urlbar.suggest.quicksuggest.nonsponsored" = false; "browser.formfill.enable" = false; "security.insecure_connection_text.enabled" = true; "security.insecure_connection_text.pbmode.enabled" = true; "network.IDN_show_punycode" = true; # HTTPS-FIRST POLICY "dom.security.https_first" = true; # PASSWORDS "signon.rememberSignons" = false; "signon.formlessCapture.enabled" = false; "signon.privateBrowsingCapture.enabled" = false; "network.auth.subresource-http-auth-allow" = 1; "editor.truncate_user_pastes" = false; # ADDRESS + CREDIT CARD MANAGER "extensions.formautofill.addresses.enabled" = false; "extensions.formautofill.creditCards.enabled" = false; # MIXED CONTENT + CROSS-SITE "security.mixed_content.block_display_content" = true; "security.mixed_content.upgrade_display_content" = true; "security.mixed_content.upgrade_display_content.image" = true; "pdfjs.enableScripting" = false; "extensions.postDownloadThirdPartyPrompt" = false; # HEADERS / REFERERS "network.http.referer.XOriginTrimmingPolicy" = 2; # CONTAINERS "privacy.userContext.ui.enabled" = true; # WEBRTC "media.peerconnection.ice.proxy_only_if_behind_proxy" = true; "media.peerconnection.ice.default_address_only" = true; # SAFE BROWSING "browser.safebrowsing.downloads.remote.enabled" = false; # MOZILLA "permissions.default.desktop-notification" = 2; "permissions.default.geo" = 2; "geo.provider.network.url" = "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%"; "permissions.manager.defaultsUrl" = ""; "webchannel.allowObject.urlWhitelist" = ""; # TELEMETRY "datareporting.policy.dataSubmissionEnabled" = false; "datareporting.healthreport.uploadEnabled" = false; "toolkit.telemetry.unified" = false; "toolkit.telemetry.enabled" = false; "toolkit.telemetry.server" = "data:,"; "toolkit.telemetry.archive.enabled" = false; "toolkit.telemetry.newProfilePing.enabled" = false; "toolkit.telemetry.shutdownPingSender.enabled" = false; "toolkit.telemetry.updatePing.enabled" = false; "toolkit.telemetry.bhrPing.enabled" = false; "toolkit.telemetry.firstShutdownPing.enabled" = false; "toolkit.telemetry.coverage.opt-out" = true; "toolkit.coverage.opt-out" = true; "toolkit.coverage.endpoint.base" = ""; "browser.ping-centre.telemetry" = false; "browser.newtabpage.activity-stream.feeds.telemetry" = false; "browser.newtabpage.activity-stream.telemetry" = false; # EXPERIMENTS "app.shield.optoutstudies.enabled" = false; "app.normandy.enabled" = false; "app.normandy.api_url" = ""; # CRASH REPORTS "breakpad.reportURL" = ""; "browser.tabs.crashReporting.sendReport" = false; "browser.crashReports.unsubmittedCheck.autoSubmit2" = false; # DETECTION "captivedetect.canonicalURL" = ""; "network.captive-portal-service.enabled" = false; "network.connectivity-service.enabled" = false; # SECTION: PESKYFOX # MOZILLA UI "browser.privatebrowsing.vpnpromourl" = ""; "extensions.getAddons.showPane" = false; "extensions.htmlaboutaddons.recommendations.enabled" = false; "browser.discovery.enabled" = false; "browser.shell.checkDefaultBrowser" = false; "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false; "browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false; "browser.preferences.moreFromMozilla" = false; "browser.tabs.tabmanager.enabled" = false; "browser.aboutConfig.showWarning" = false; "browser.aboutwelcome.enabled" = false; # THEME ADJUSTMENTS "toolkit.legacyUserProfileCustomizations.stylesheets" = true; "browser.compactmode.show" = true; "browser.display.focus_ring_on_anything" = true; "browser.display.focus_ring_style" = 0; "browser.display.focus_ring_width" = 0; "layout.css.prefers-color-scheme.content-override" = 2; "browser.privateWindowSeparation.enabled" = false; # WINDOWS # COOKIE BANNER HANDLING "cookiebanners.service.mode" = 1; "cookiebanners.service.mode.privateBrowsing" = 1; "cookiebanners.service.enableGlobalRules" = true; # FULLSCREEN NOTICE "full-screen-api.transition-duration.enter" = "0 0"; "full-screen-api.transition-duration.leave" = "0 0"; "full-screen-api.warning.delay" = -1; "full-screen-api.warning.timeout" = 0; # URL BAR "browser.urlbar.suggest.calculator" = true; "browser.urlbar.unitConversion.enabled" = true; "browser.urlbar.trending.featureGate" = false; # NEW TAB PAGE "browser.newtabpage.activity-stream.feeds.topsites" = false; "browser.newtabpage.activity-stream.feeds.section.topstories" = false; # POCKET "extensions.pocket.enabled" = false; # DOWNLOADS "browser.download.useDownloadDir" = false; "browser.download.always_ask_before_handling_new_types" = true; "browser.download.manager.addToRecentDocs" = false; # PDF "browser.download.open_pdf_attachments_inline" = true; # TAB BEHAVIOR "browser.bookmarks.openInTabClosesMenu" = false; "browser.menu.showViewImageInfo" = true; "findbar.highlightAll" = true; "layout.word_select.eat_space_to_next_word" = false; # SECTION: SMOOTHFOX # SCROLLING OVERRIDES # visit https://github.com/yokoffing/Betterfox/blob/main/Smoothfox.js "apz.overscroll.enabled" = true; # DEFAULT NON-LINUX "general.smoothScroll" = true; # DEFAULT "general.smoothScroll.msdPhysics.continuousMotionMaxDeltaMS" = 12; "general.smoothScroll.msdPhysics.enabled" = true; "general.smoothScroll.msdPhysics.motionBeginSpringConstant" = 600; "general.smoothScroll.msdPhysics.regularSpringConstant" = 650; "general.smoothScroll.msdPhysics.slowdownMinDeltaMS" = 25; "general.smoothScroll.msdPhysics.slowdownMinDeltaRatio" = 2.0; "general.smoothScroll.msdPhysics.slowdownSpringConstant" = 250; "general.smoothScroll.currentVelocityWeighting" = 1.0; "general.smoothScroll.stopDecelerationWeighting" = 1.0; "mousewheel.default.delta_multiplier_y" = 300; # 250-400; adjust this number to your liking }; }; profiles.panotaka = { settings = { "widget.use-xdg-desktop-portal.file-picker" = 1; }; userChrome = '' /* # arcticfox - userChrome - under MPL 2.0 dragon's (very hacky) arc browser-like theme for firefox ft. sidebery, and userchrome-toggle !!! for the theme to work: - the side bar needs to always be visible and with sidebery (maybe TST but nothing guaranteed) opened - the order of the toolbar widgets should be: [url-bar sidebar-toggle back forward reload spacer extensions overflow hamburger-menu] you can change the order of some of those, but the url bar must be the first item - preferencially have userchrome-toggle addon or something else to toggle keeping the sidebar opened - disable the bookmarks toolbar - use flat color themes instead of ones with gradients or backgrounds, preferencially themes from Firefox Color when navigating this file you can use ctrl + f (or whatever the 'find' shortuc is on your editor) to jump to spefic parts: ## for sections // for comments ** for thing you can change !!! some extra warnings (drawbacks) - the menu bar (activated with alt) doesn't work - the bookmarks toolbar doesn't work - the 'customise toolbar...' page will not let you rearrange things in the toolbar, do it with the theme disabled (can still put things in the overflow menu tho) - there will be visual glitches in certain areas, for example in some places the background may be transparent (showing behind the window) and flicker - pages and addons that expect ui elements to be in certain places may nor work - some browser color themes may not work well or need some tweak - some menus you open (or if change the addon in the sidebar) may toggle off the window preface and not keep the sidebar open - using addons that use the sidebar (for example firefox side view) is awkard - might not work well depending on your window controls */ :root { /* ** spacing around the web page and other things */ --spacing: .75rem; /* ** sidebar width when open */ --sdb-wdt-max: 360px; /* // sidebar width (don't change this setup) */ /* --sdb-wdt: var(--sdb-wdt-max); */ --sdb-wdt: 0; /* ** theme border radius */ --br: 10px; /* **? height of the toolbox (browser header/tool bar) */ --toolbox-height: 6.25rem; /* ** transitions (mainly sidebar) duration */ --trans: .5s; /* // browser background color, don't change this var */ --bbg: var(--lwt-accent-color-inactive, var(--lwt-accent-color)); } /* // hide the contens of the toolbox by default // and give some padding area to be able to hover it */ #navigator-toolbox { padding-right: var(--spacing); } #navigator-toolbox > * { opacity: 0%; } /* // when hovering the toolbox or sidebar, show them ** you can change the 'preface' value wish normal CSS had sass,stylus,less style nesting */ #main-window[titlepreface*="|| "], #main-window:has(#sidebar-box:hover), #main-window:has(#navigator-toolbox:hover), #main-window:has(#navigator-toolbox:focus-within), #main-window:has(toolbarbutton[open="true"]) { --sdb-wdt: var(--sdb-wdt-max); } #main-window[titlepreface*="|| "] #navigator-toolbox, #main-window:has(#sidebar-box:hover) #navigator-toolbox, #main-window:has(#navigator-toolbox:hover) #navigator-toolbox, #main-window:has(#navigator-toolbox:focus-within) #navigator-toolbox, #main-window:has(toolbarbutton[open="true"]) #navigator-toolbox { padding-right: 0; } #main-window[titlepreface*="|| "] #navigator-toolbox > *, #main-window:has(#sidebar-box:hover) #navigator-toolbox > *, #main-window:has(#navigator-toolbox:hover) #navigator-toolbox > *, #main-window:has(#navigator-toolbox:focus-within) #navigator-toolbox > *, #main-window:has(toolbarbutton[open="true"]) #navigator-toolbox > * { opacity: 100%; } /* // background of the area around the web page */ .browserStack { background: var(--bbg); } #appcontent { height: 100vh; /* // offset the web page up to fit the browser height */ margin-top: calc(var(--toolbox-height) * -1); } /* // for the toolbox to not hide in fullscreen */ #navigator-toolbox[inFullscreen="true"] { margin-top: 0 !important; } /* // reset the web page offset when playing some video in fullscreen */ #main-window[inDOMFullscreen="true"] #appcontent { margin-top: 0; } #appcontent browser { margin: var(--spacing); margin-left: 0; margin-top: var(--spacing); border-radius: var(--br); box-sizing: border-box; /* ** small details to separate the web page from the surroundings // feel free to disable these, and use Adaptive Tab Bar Color to make the entire browser fit the page color */ box-shadow: 0px 0px 7px #00000030; border: 1px solid #fafafa30; } /* // remove margin from the dev tools */ #appcontent .devtools-toolbox-side-iframe { margin: 0 !important; } #appcontent .devtools-toolbox-bottom-iframe { margin: 0; border-radius: 0; } /* // make status panel (the bar with url when you hover links) * // fit better with theme */ #statuspanel { margin-bottom: var(--spacing); margin-right: var(--spacing); } #statuspanel-label { background: var(--bbg) !important; border: 1px solid #00000020 !important; color: var(--toolbar-color) !important;; } /* // make find bar fit with theme */ findbar { background: var(--bbg) !important; border: none !important; padding-top: 0 !important;; } /* #sidebar-box { display: block !important; } */ /* // hide the sidebar header (only when sidebery opened) ** feel free to disable this ** or change the sidebarcommand to some other addon (get from browser dev mode) */ #sidebar-box[sidebarcommand="_3c078156-979c-498b-8990-85f7987dd929_-sidebar-action"] #sidebar-header { display: none; /* */ } #sidebar-header { border: none !important;; } /* // hide the sidebar close button (closing the sidebar messes the theme) */ #sidebar-header #sidebar-close { display: none; } #sidebar-box { padding-right: var(--spacing); background: var(--bbg) !important; min-width: 0px !important; width: var(--sdb-wdt) !important; overflow: clip; transition: width var(--trans); } #sidebar-splitter { display: none; } #sidebar { overflow: clip; /*border-radius: var(--br); */ /* // adds some visual glitches */ /* // keep the sidebar content in a specific size */ width: calc(var(--sdb-wdt-max) - var(--spacing) * 0.5); margin-left: calc(var(--spacing) * 0.4); } #main-window #titlebar { overflow: clip; } /* // default state: Set initial height to enable animation */ #main-window #titlebar { height: 3rem !important; } #main-window[uidensity="touch"] #titlebar { height: 3.35em !important; } #main-window[uidensity="compact"] #titlebar { height: 2.7em !important; } /* // hide the defaul tab bar and the private window label */ #tabbrowser-tabs, #alltabs-button, #new-tab-button, #private-browsing-indicator-with-label { display: none; } :root { /* ** feel free to change this color */ --poiple: #6e00bc; } /* ** in private window, put an outline around the page and url bar */ #main-window[privatebrowsingmode="temporary"] #appcontent browser { border: 1px solid var(--poiple); } #main-window[privatebrowsingmode="temporary"] { --toolbar-field-border-color: var(--poiple) !important; } #navigator-toolbox { padding-bottom: var(--spacing); transition: width var(--trans); border: none !important; border-radius: 0 !important; } .titlebar-buttonbox-container { margin-top: .5rem; } #navigator-toolbox { width: var(--sdb-wdt); height: var(--toolbox-height); } #navigator-toolbox > * { transition: opacity var(--trans); } /* // show toolbar if sidebar is closed (so you can open it with the button) */ #main-window:has(#sidebar-box[hidden="true"]) #navigator-toolbox { --sdb-wdt: var(--sdb-wdt-max); border-radius: 0 0 var(--br) 0 !important;; padding: 0 !important; z-index: 1; } #main-window:has(#sidebar-box[hidden="true"]) #navigator-toolbox > * { opacity: 100%; } /* // hide sidebar button (when sidebar is open) // closing the sidebar messes up the theme */ #main-window:has(#sidebar-box:not([hidden="true"])) #sidebar-button { display: none; /* */ } #main-window:has(#sidebar-box[hidden="true"]) #sidebar-button { border: 1px solid #fafafaa0; background: #fafafa20; border-radius: var(--br); margin: .25rem !important;; } #main-window:has(#sidebar-box[hidden="true"]) #appcontent browser { margin-left: var(--spacing); } /* ** WINDOWS - make the window buttons less huge // uncomment if you're on windows. recomended --wbt-wdt: 7rem */ /* .titlebar-buttonbox { margin-right: var(--spacing); border-radius: calc(var(--br) / 2); max-width: 7.5rem; justify-content: center; overflow: clip; } .titlebar-buttonbox .titlebar-button { padding: .75rem !important; } */ #nav-bar { /* ** width of the window control buttons (min max close) that the toolbar should take into account // change to 0 if using server side decorations */ --wbt-wdt: 3.5rem; margin-top: -2.75rem; width: calc(var(--sdb-wdt) - var(--wbt-wdt)) !important; background: none !important; margin-left: calc(var(--spacing) * -.75); border: none !important; box-shadow: none !important; } #nav-bar.browser-toolbar { overflow: visible !important; height: 3rem; } #urlbar-container { position: absolute; flex: 0 !important; margin: 0; top: 2.75rem; overflow: visible !important; box-sizing: border-box !important; } /* // put the url bar in the right position */ #urlbar { width: calc(var(--sdb-wdt) - var(--spacing) * 1.5) !important; margin-left: calc(var(--spacing) * 1); height: 2.75rem; } #urlbar-background { border-radius: var(--br) !important; height: 100%; } /* // means when the suggestions list is showing */ #urlbar[breakout-extend="true"] { padding: 0 !important; width: calc(var(--sdb-wdt) - var(--spacing) * 1) !important; margin-left: calc(var(--spacing) * 1.25); border: 1px solid #fafafa40; border-radius: var(--br); box-shadow: 0px 3px 7px #00000030; } #main-window[privatebrowsingmode="temporary"] #urlbar[breakout-extend="true"] { border: 2px solid var(--poiple); } #urlbar[breakout-extend="true"] #urlbar-background { border-radius: var(--br) var(--br) 0 0 !important; } .urlbarView { background: var(--toolbar-field-focus-background-color) !important; width: calc(100%) !important; margin-left: 0 !important; margin-top: -.25rem !important; box-sizing: border-box; border-radius: 0 0 var(--br) var(--br); } /* ## extras // feel free to comment or uncomment each setting I personally would recommend to keep them to keep stuff cleaner */ /* ** hide reader mode button when editing url bar */ #urlbar[breakout-extend="true"] #reader-mode-button { display: none; } /* hide pip mode button when editing url bar */ #urlbar[breakout-extend="true"] #picture-in-picture-button { display: none; } /* ** hide "Shield" icon */ #urlbar:not(:hover) #tracking-protection-icon-container { width: 0; overflow: clip; } /* ** hide Site information buttons */ #urlbar:not(:hover) #identity-box { width: 0; overflow: clip; } /* ** hide the "Search with" indicator on the urlbar */ #urlbar-search-mode-indicator { display: none; } /* ** hide the "Always open in container" button */ #urlbar #pageAction-urlbar-_testpilot-containers { display: none; } /* ** hide Container name */ #userContext-label, #userContext-icons, #userContext-indicator { display: none; } /* ** hide identity box */ #identity-box { width: 0px; overflow: hidden; } /* ** hide 'open in side view' button*/ #pageAction-urlbar-side-view_mozilla_org { display: none; } ''; }; /* package = pkgs.wrapFirefox pkgs.firefox-unwrapped { nixExtensions = with config.nur.repos.rycee.firefox-addons; [ ublock-origin localcdn sidebery user-agent-switcher-and-manager ]; extraPolicies = { CaptivePortal = false; DisableFirefoxStudies = true; DisablePocket = true; DisableTelemetry = true; DisableFirefoxAccounts = true; FirefoxHome = { Pocket = false; Snippets = false; }; UserMessaging = { ExtensionRecommendations = false; SkipOnboarding = true; }; }; }; */ }; }; }