2025-02-28 15:46:22 +01:00
|
|
|
{ config
|
|
|
|
, lib
|
|
|
|
, pkgs
|
|
|
|
, ...
|
|
|
|
}: {
|
2025-03-04 16:57:50 +01:00
|
|
|
enable = true;
|
|
|
|
# package = pkgs.firefox;
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
profiles = {
|
|
|
|
default = {
|
|
|
|
isDefault = true;
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
# userChrome = ''
|
|
|
|
# @-moz-document url(chrome://browser/content/browser.xhtml) {
|
|
|
|
# /* tabs on bottom of window */
|
|
|
|
# /* requires that you set
|
|
|
|
# * toolkit.legacyUserProfileCustomizations.stylesheets = true
|
|
|
|
# * in about:config
|
|
|
|
# */
|
|
|
|
# #main-window body { flex-direction: column-reverse !important; }
|
|
|
|
# #navigator-toolbox { flex-direction: column-reverse !important; }
|
|
|
|
# #urlbar {
|
|
|
|
# top: unset !important;
|
|
|
|
# bottom: calc(var(--urlbar-margin-inline)) !important;
|
|
|
|
# box-shadow: none !important;
|
|
|
|
# display: flex !important;
|
|
|
|
# flex-direction: column !important;
|
|
|
|
# }
|
|
|
|
# #urlbar > * {
|
|
|
|
# flex: none;
|
|
|
|
# }
|
|
|
|
# #urlbar-input-container {
|
|
|
|
# order: 2;
|
|
|
|
# }
|
|
|
|
# #urlbar > .urlbarView {
|
|
|
|
# order: 1;
|
|
|
|
# border-bottom: 1px solid #666;
|
|
|
|
# }
|
|
|
|
# #urlbar-results {
|
|
|
|
# display: flex;
|
|
|
|
# flex-direction: column-reverse;
|
|
|
|
# }
|
|
|
|
# .search-one-offs { display: none !important; }
|
|
|
|
# .tab-background { border-top: none !important; }
|
|
|
|
# #navigator-toolbox::after { border: none; }
|
|
|
|
# #TabsToolbar .tabbrowser-arrowscrollbox,
|
|
|
|
# #tabbrowser-tabs, .tab-stack { min-height: 28px !important; }
|
|
|
|
# .tabbrowser-tab { font-size: 80%; }
|
|
|
|
# .tab-content { padding: 0 5px; }
|
|
|
|
# .tab-close-button .toolbarbutton-icon { width: 12px !important; height: 12px !important; }
|
|
|
|
# toolbox[inFullscreen=true] { display: none; }
|
|
|
|
# /*
|
|
|
|
# * the following makes it so that the on-click panels in the nav-bar
|
|
|
|
# * extend upwards, not downwards. some of them are in the #mainPopupSet
|
|
|
|
# * (hamburger + unified extensions), and the rest are in
|
|
|
|
# * #navigator-toolbox. They all end up with an incorrectly-measured
|
|
|
|
# * max-height (based on the distance to the _bottom_ of the screen), so
|
|
|
|
# * we correct that. The ones in #navigator-toolbox then adjust their
|
|
|
|
# * positioning automatically, so we can just set max-height. The ones
|
|
|
|
# * in #mainPopupSet do _not_, and so we need to give them a
|
|
|
|
# * negative margin-top to offset them *and* a fixed height so their
|
|
|
|
# * bottoms align with the nav-bar. We also calc to ensure they don't
|
|
|
|
# * end up overlapping with the nav-bar itself. The last bit around
|
|
|
|
# * cui-widget-panelview is needed because "new"-style panels (those
|
|
|
|
# * using "unified" panels) don't get flex by default, which results in
|
|
|
|
# * them being the wrong height.
|
|
|
|
# *
|
|
|
|
# * Oh, yeah, and the popup-notification-panel (like biometrics prompts)
|
|
|
|
# * of course follows different rules again, and needs its own special
|
|
|
|
# * rule.
|
|
|
|
# */
|
|
|
|
# #mainPopupSet panel.panel-no-padding { margin-top: calc(-50vh + 40px) !important; }
|
|
|
|
# #mainPopupSet .panel-viewstack, #mainPopupSet popupnotification { max-height: 50vh !important; height: 50vh; }
|
|
|
|
# #mainPopupSet panel.panel-no-padding.popup-notification-panel { margin-top: calc(-50vh - 35px) !important; }
|
|
|
|
# #navigator-toolbox .panel-viewstack { max-height: 75vh !important; }
|
|
|
|
# panelview.cui-widget-panelview { flex: 1; }
|
|
|
|
# panelview.cui-widget-panelview > vbox { flex: 1; min-height: 50vh; }
|
|
|
|
# }
|
|
|
|
# '';
|
|
|
|
settings = {
|
|
|
|
# Disable internal passwod manager
|
|
|
|
"signon.rememberSignons" = false;
|
|
|
|
# Extensions are managed with Nix, so don't update.
|
|
|
|
"extensions.update.autoUpdateDefault" = false;
|
|
|
|
"extensions.update.enabled" = false;
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-05 10:08:52 +01:00
|
|
|
# Default Apps are also managed via Nix
|
|
|
|
"browser.shell.checkDefaultBrowser" = false;
|
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
# Default to dark theme in DevTools panel
|
|
|
|
"devtools.theme" = "dark";
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
# Reduce search engine noise in the urlbar's completion window. The
|
|
|
|
# shortcuts and suggestions will still work, but Firefox won't clutter
|
|
|
|
# its UI with reminders that they exist.
|
|
|
|
"browser.urlbar.suggest.searches" = true; # Let's hope duckduckgo doesn't sell it all :)
|
|
|
|
"browser.urlbar.shortcuts.bookmarks" = false;
|
|
|
|
"browser.urlbar.shortcuts.history" = false;
|
|
|
|
"browser.urlbar.shortcuts.tabs" = false;
|
|
|
|
"browser.urlbar.showSearchSuggestionsFirst" = false;
|
|
|
|
"browser.urlbar.speculativeConnect.enabled" = false;
|
|
|
|
"browser.urlbar.suggest.quicksuggest.nonsponsored" = false;
|
|
|
|
"browser.urlbar.suggest.quicksuggest.sponsored" = false;
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
# Disable some not so useful functionality.
|
|
|
|
"browser.disableResetPrompt" = true; # "Looks like you haven't started Firefox in a while."
|
|
|
|
"browser.onboarding.enabled" = false; # "New to Firefox? Let's get started!" tour
|
|
|
|
"browser.aboutConfig.showWarning" = false; # Warning when opening about:config
|
|
|
|
"extensions.pocket.enabled" = false;
|
|
|
|
"extensions.shield-recipe-client.enabled" = false;
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
# Sync
|
|
|
|
# "services.sync.username" = config.etu.user.email;
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
"services.sync.engine.addons" = false; # Do not sync extensions.
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
"general.autoScroll" = true; # Middle click to scroll
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
"browser.startup.page" = 3; # Restore previous windows and tabs.
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
# Security-oriented defaults
|
|
|
|
"security.family_safety.mode" = 0;
|
|
|
|
# https://blog.mozilla.org/security/2016/10/18/phasing-out-sha-1-on-the-public-web/
|
|
|
|
"security.pki.sha1_enforcement_level" = 1;
|
|
|
|
# https://github.com/tlswg/tls13-spec/issues/1001
|
|
|
|
"security.tls.enable_0rtt_data" = false;
|
|
|
|
# Use Mozilla geolocation service instead of Google if given permission
|
|
|
|
"geo.provider.network.url" = "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%";
|
|
|
|
"geo.provider.use_gpsd" = false;
|
|
|
|
# https://support.mozilla.org/en-US/kb/extension-recommendations
|
|
|
|
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr" = false;
|
|
|
|
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons" = false;
|
|
|
|
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr.features" = false;
|
|
|
|
"extensions.htmlaboutaddons.recommendations.enabled" = false;
|
|
|
|
"extensions.htmlaboutaddons.discover.enabled" = false;
|
|
|
|
"extensions.htmlaboutaddons.inline-options.enabled" = false;
|
|
|
|
"extensions.getAddons.showPane" = false; # uses Google Analytics
|
|
|
|
"browser.discovery.enabled" = false;
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
# Privacy enhancements
|
|
|
|
"browser.newtabpage.activity-stream.feeds.telemetry" = false;
|
|
|
|
"browser.newtabpage.activity-stream.telemetry" = false;
|
|
|
|
"browser.newtabpage.activity-stream.feeds.snippets" = false;
|
|
|
|
"browser.newtabpage.activity-stream.feeds.section.topstories" = false;
|
|
|
|
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
|
|
|
|
"browser.newtabpage.activity-stream.showSponsored" = false;
|
|
|
|
"browser.newtabpage.activity-stream.feeds.discoverystreamfeed" = false;
|
|
|
|
"browser.newtabpage.activity-stream.showSponsoredTopSites" = false;
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
# Improve performance
|
|
|
|
"gfx.webrender.all" = true;
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
# Enable ETP for decent security (makes firefox containers and many
|
|
|
|
# common security/privacy add-ons redundant).
|
|
|
|
"browser.contentblocking.category" = "strict";
|
|
|
|
"privacy.purge_trackers.enabled" = true;
|
|
|
|
# Do Not Track header
|
|
|
|
"privacy.donottrackheader.enabled" = true;
|
|
|
|
"privacy.donottrackheader.value" = 1;
|
|
|
|
# Disable Private Attribution Tracking Foo
|
|
|
|
"dom.private-attribution.submission.enabled" = false;
|
|
|
|
# Your customized toolbar settings are stored in
|
|
|
|
# 'browser.uiCustomization.state'. This tells firefox to sync it between
|
|
|
|
# machines. WARNING: This may not work across OSes. Since I use NixOS on
|
|
|
|
# all the machines I use Firefox on, this is no concern to me.
|
|
|
|
"services.sync.prefs.sync.browser.uiCustomization.state" = true;
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
# Enable userChrome customisations
|
|
|
|
"toolkit.legacyUserProfileCustomizations.stylesheets" = false; # TODO Reenable with fixed tabs on bottom css
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
# Reduce File IO / SSD abuse
|
|
|
|
# Otherwise, Firefox bombards the HD with writes. Not so nice for SSDs.
|
|
|
|
# This forces it to write every 15 minutes, rather than 15 seconds.
|
|
|
|
"browser.sessionstore.interval" = "900000";
|
|
|
|
# Disable battery API
|
|
|
|
"dom.battery.enabled" = false;
|
|
|
|
# Disable "beacon" asynchronous HTTP transfers (used for analytics)
|
|
|
|
"beacon.enabled" = false;
|
|
|
|
# Disable pinging URIs specified in HTML <a> ping= attributes
|
|
|
|
"browser.send_pings" = false;
|
|
|
|
# Disable gamepad API to prevent USB device enumeration
|
|
|
|
"dom.gamepad.enabled" = false;
|
|
|
|
# Don't try to guess domain names when entering an invalid domain name in URL bar
|
|
|
|
"browser.fixup.alternate.enabled" = false;
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
# Disable telemetry
|
|
|
|
"toolkit.telemetry.unified" = false;
|
|
|
|
"toolkit.telemetry.enabled" = false;
|
|
|
|
"toolkit.telemetry.server" = "data:,";
|
|
|
|
"toolkit.telemetry.archive.enabled" = false;
|
|
|
|
"toolkit.telemetry.coverage.opt-out" = true;
|
|
|
|
"toolkit.coverage.opt-out" = true;
|
|
|
|
"toolkit.coverage.endpoint.base" = "";
|
|
|
|
"experiments.supported" = false;
|
|
|
|
"experiments.enabled" = false;
|
|
|
|
"experiments.manifest.uri" = "";
|
|
|
|
"browser.ping-centre.telemetry" = false;
|
|
|
|
# https://mozilla.github.io/normandy/
|
|
|
|
"app.normandy.enabled" = false;
|
|
|
|
"app.normandy.api_url" = "";
|
|
|
|
"app.shield.optoutstudies.enabled" = false;
|
|
|
|
# Disable health reports (basically more telemetry)
|
|
|
|
# https://support.mozilla.org/en-US/kb/firefox-health-report-understand-your-browser-perf
|
|
|
|
# https://gecko.readthedocs.org/en/latest/toolkit/components/telemetry/telemetry/preferences.html
|
|
|
|
"datareporting.healthreport.uploadEnabled" = false;
|
|
|
|
"datareporting.healthreport.service.enabled" = false;
|
|
|
|
"datareporting.policy.dataSubmissionEnabled" = false;
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
# Disable crash reports
|
|
|
|
"breakpad.reportURL" = "";
|
|
|
|
"browser.tabs.crashReporting.sendReport" = false;
|
|
|
|
"browser.crashReports.unsubmittedCheck.autoSubmit2" = false; # don't submit backlogged reports
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
# Disable Form autofill
|
|
|
|
# https://wiki.mozilla.org/Firefox/Features/Form_Autofill
|
|
|
|
"browser.formfill.enable" = false;
|
|
|
|
"extensions.formautofill.addresses.enabled" = false;
|
|
|
|
"extensions.formautofill.available" = "off";
|
|
|
|
"extensions.formautofill.creditCards.available" = false;
|
|
|
|
"extensions.formautofill.creditCards.enabled" = false;
|
|
|
|
"extensions.formautofill.heuristics.enabled" = false;
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
# VAAPI ffmpeg foo
|
|
|
|
"media.ffmpeg.vaapi.enabled" = true;
|
|
|
|
};
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
extensions.packages = with pkgs.nur.repos.rycee.firefox-addons; [
|
|
|
|
bitwarden
|
|
|
|
# clearurls
|
|
|
|
consent-o-matic
|
|
|
|
darkreader
|
|
|
|
dearrow
|
|
|
|
deutsch-de-language-pack
|
|
|
|
dictionary-german
|
|
|
|
df-youtube
|
|
|
|
flagfox
|
|
|
|
ipvfoo
|
|
|
|
leechblock-ng
|
|
|
|
localcdn
|
|
|
|
kagi-search
|
|
|
|
plasma-integration
|
|
|
|
privacy-badger
|
|
|
|
rust-search-extension
|
|
|
|
sidebery
|
|
|
|
skip-redirect
|
|
|
|
sponsorblock
|
|
|
|
tab-stash
|
|
|
|
ublock-origin
|
|
|
|
unpaywall
|
|
|
|
];
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
search = {
|
|
|
|
force = true;
|
|
|
|
default = "Kagi";
|
|
|
|
privateDefault = "DuckDuckGo";
|
|
|
|
# default = "DuckDuckGo";
|
|
|
|
# privateDefault = "Kagi";
|
|
|
|
order = [ "Kagi" "DuckDuckGo" "Nix Packages" "Nix Options" "NixOS Wiki" ];
|
2025-02-28 15:46:22 +01:00
|
|
|
|
2025-03-04 16:57:50 +01:00
|
|
|
engines = {
|
|
|
|
"Kagi" = {
|
|
|
|
urls = [{ template = "https://kagi.com/search?q={searchTerms}"; }];
|
|
|
|
definedAliases = [ "@k" ];
|
|
|
|
iconUpdateURL = "https://kagi.com/favicon.ico";
|
|
|
|
updateInterval = 24 * 60 * 60 * 1000; # every day
|
2025-02-28 15:46:22 +01:00
|
|
|
};
|
2025-03-04 16:57:50 +01:00
|
|
|
"DuckDuckGo".metaData = {
|
|
|
|
alias = "@ddg";
|
|
|
|
};
|
|
|
|
"Nix Packages" = {
|
|
|
|
urls = [
|
2025-02-28 15:46:22 +01:00
|
|
|
{
|
2025-03-04 16:57:50 +01:00
|
|
|
template = "https://search.nixos.org/packages";
|
|
|
|
params = [
|
|
|
|
{
|
|
|
|
name = "type";
|
|
|
|
value = "packages";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "query";
|
|
|
|
value = "{searchTerms}";
|
|
|
|
}
|
|
|
|
];
|
2025-02-28 15:46:22 +01:00
|
|
|
}
|
|
|
|
];
|
2025-03-04 16:57:50 +01:00
|
|
|
|
|
|
|
icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
|
|
|
|
|
|
|
definedAliases = [ "@np" ];
|
|
|
|
};
|
|
|
|
"Nix Options" = {
|
|
|
|
urls = [
|
2025-02-28 15:46:22 +01:00
|
|
|
{
|
2025-03-04 16:57:50 +01:00
|
|
|
template = "https://search.nixos.org/options";
|
|
|
|
params = [
|
|
|
|
{
|
|
|
|
name = "type";
|
|
|
|
value = "options";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "query";
|
|
|
|
value = "{searchTerms}";
|
|
|
|
}
|
|
|
|
];
|
2025-02-28 15:46:22 +01:00
|
|
|
}
|
2025-03-04 16:57:50 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
|
|
|
|
|
|
|
definedAliases = [ "@no" ];
|
|
|
|
};
|
|
|
|
"Home-Manager Options" = {
|
|
|
|
urls = [
|
2025-02-28 15:46:22 +01:00
|
|
|
{
|
2025-03-04 16:57:50 +01:00
|
|
|
template = "https://mipmip.github.io/home-manager-option-search";
|
|
|
|
params = [
|
2025-02-28 15:46:22 +01:00
|
|
|
{
|
2025-03-04 16:57:50 +01:00
|
|
|
name = "query";
|
|
|
|
value = "{searchTerms}";
|
2025-02-28 15:46:22 +01:00
|
|
|
}
|
|
|
|
{
|
2025-03-04 16:57:50 +01:00
|
|
|
name = "release";
|
|
|
|
value = "master";
|
2025-02-28 15:46:22 +01:00
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
2025-03-04 16:57:50 +01:00
|
|
|
|
|
|
|
icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
|
|
|
|
|
|
|
definedAliases = [ "@ho" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
"NixOS Wiki" = {
|
|
|
|
urls = [
|
|
|
|
{
|
|
|
|
template = "https://nixos.wiki/index.php?search={searchTerms}";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
iconUpdateURL = "https://nixos.wiki/favicon.png";
|
|
|
|
updateInterval = 24 * 60 * 60 * 1000;
|
|
|
|
definedAliases = [ "@nw" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
"Bing".metaData.hidden = true;
|
|
|
|
"Amazon.de".metaData.hidden = true;
|
|
|
|
"Google".metaData = {
|
|
|
|
alias = "@g";
|
|
|
|
hidden = true;
|
|
|
|
};
|
|
|
|
};
|
2025-02-28 15:46:22 +01:00
|
|
|
};
|
2025-03-04 16:57:50 +01:00
|
|
|
|
|
|
|
bookmarks = [
|
|
|
|
{
|
|
|
|
toolbar = true;
|
|
|
|
bookmarks = [
|
|
|
|
{
|
|
|
|
name = "Home Manager";
|
|
|
|
url = "https://nixos.wiki/wiki/Home_Manager";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "Nix PR Channel Tracker";
|
|
|
|
url = "https://nixpk.gs/pr-tracker.html";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "Chaotic Nix";
|
|
|
|
url = "https://www.nyx.chaotic.cx/";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "wikipedia";
|
|
|
|
tags = [ "wiki" ];
|
|
|
|
keyword = "wiki";
|
|
|
|
url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "kernel.org";
|
|
|
|
url = "https://www.kernel.org";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "Nix sites";
|
|
|
|
bookmarks = [
|
|
|
|
{
|
|
|
|
name = "homepage";
|
|
|
|
url = "https://nixos.org/";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "wiki";
|
|
|
|
tags = [ "wiki" "nix" ];
|
|
|
|
url = "https://nixos.wiki/";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "Nix sites";
|
|
|
|
bookmarks = [
|
|
|
|
{
|
|
|
|
name = "homepage";
|
|
|
|
url = "https://nixos.org/";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "wiki";
|
|
|
|
url = "https://nixos.wiki/";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
];
|
2025-02-28 15:46:22 +01:00
|
|
|
};
|
2025-03-04 16:57:50 +01:00
|
|
|
};
|
|
|
|
}
|