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 = {
2025-03-07 21:14:34 +01:00
# Search foo
" b r o w s e r . s e a r c h . s u g g e s t . e n a b l e d " = true ;
" b r o w s e r . s e a r c h . s u g g e s t . e n a b l e d . p r i v a t e " = false ;
" b r o w s e r . s e a r c h . u p d a t e " = false ;
" s e r v i c e s . s y n c . p r e f s . s y n c . b r o w s e r . s e a r c h . u p d a t e " = false ;
2025-03-07 16:35:35 +01:00
2025-03-04 16:57:50 +01:00
# Disable internal passwod manager
" s i g n o n . r e m e m b e r S i g n o n s " = false ;
# Extensions are managed with Nix, so don't update.
2025-03-10 14:09:28 +01:00
" e x t e n s i o n s . a u t o D i s a b l e S c o p e s " = 0 ; # do not auto-disable all newly added extensions
2025-03-04 16:57:50 +01:00
" e x t e n s i o n s . u p d a t e . a u t o U p d a t e D e f a u l t " = false ;
" e x t e n s i o n s . u p d a t e . e n a b l e d " = false ;
2025-02-28 15:46:22 +01:00
2025-03-07 21:14:34 +01:00
# Default Apps are also managed via Nix
" b r o w s e r . s h e l l . c h e c k D e f a u l t B r o w s e r " = false ;
2025-03-05 10:08:52 +01:00
2025-03-04 16:57:50 +01:00
# Default to dark theme in DevTools panel
" d e v t o o l s . t h e m e " = " d a r k " ;
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.
" b r o w s e r . u r l b a r . s u g g e s t . s e a r c h e s " = true ; # Let's hope duckduckgo doesn't sell it all :)
2025-03-10 12:22:28 +01:00
" b r o w s e r . u r l b a r . s h o r t c u t s . b o o k m a r k s " = true ;
" b r o w s e r . u r l b a r . s h o r t c u t s . h i s t o r y " = true ;
" b r o w s e r . u r l b a r . s h o r t c u t s . t a b s " = true ;
2025-03-04 16:57:50 +01:00
" b r o w s e r . u r l b a r . s h o w S e a r c h S u g g e s t i o n s F i r s t " = false ;
" b r o w s e r . u r l b a r . s p e c u l a t i v e C o n n e c t . e n a b l e d " = false ;
" b r o w s e r . u r l b a r . s u g g e s t . q u i c k s u g g e s t . n o n s p o n s o r e d " = false ;
" b r o w s e r . u r l b a r . s u g g e s t . q u i c k s u g g e s t . s p o n s o r e d " = false ;
2025-02-28 15:46:22 +01:00
2025-03-04 16:57:50 +01:00
# Disable some not so useful functionality.
" b r o w s e r . d i s a b l e R e s e t P r o m p t " = true ; # "Looks like you haven't started Firefox in a while."
" b r o w s e r . o n b o a r d i n g . e n a b l e d " = false ; # "New to Firefox? Let's get started!" tour
" b r o w s e r . a b o u t C o n f i g . s h o w W a r n i n g " = false ; # Warning when opening about:config
" e x t e n s i o n s . p o c k e t . e n a b l e d " = false ;
" e x t e n s i o n s . s h i e l d - r e c i p e - c l i e n t . e n a b l e d " = 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
" s e r v i c e s . s y n c . e n g i n e . a d d o n s " = false ; # Do not sync extensions.
2025-02-28 15:46:22 +01:00
2025-03-04 16:57:50 +01:00
" g e n e r a l . a u t o S c r o l l " = true ; # Middle click to scroll
2025-02-28 15:46:22 +01:00
2025-03-04 16:57:50 +01:00
" b r o w s e r . s t a r t u p . p a g e " = 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
" s e c u r i t y . f a m i l y _ s a f e t y . m o d e " = 0 ;
# https://blog.mozilla.org/security/2016/10/18/phasing-out-sha-1-on-the-public-web/
" s e c u r i t y . p k i . s h a 1 _ e n f o r c e m e n t _ l e v e l " = 1 ;
# https://github.com/tlswg/tls13-spec/issues/1001
" s e c u r i t y . t l s . e n a b l e _ 0 r t t _ d a t a " = false ;
# Use Mozilla geolocation service instead of Google if given permission
" g e o . p r o v i d e r . n e t w o r k . u r l " = " h t t p s : / / l o c a t i o n . s e r v i c e s . m o z i l l a . c o m / v 1 / g e o l o c a t e ? k e y = % M O Z I L L A _ A P I _ K E Y % " ;
" g e o . p r o v i d e r . u s e _ g p s d " = false ;
# https://support.mozilla.org/en-US/kb/extension-recommendations
" b r o w s e r . n e w t a b p a g e . a c t i v i t y - s t r e a m . a s r o u t e r . u s e r p r e f s . c f r " = false ;
" b r o w s e r . n e w t a b p a g e . a c t i v i t y - s t r e a m . a s r o u t e r . u s e r p r e f s . c f r . a d d o n s " = false ;
" b r o w s e r . n e w t a b p a g e . a c t i v i t y - s t r e a m . a s r o u t e r . u s e r p r e f s . c f r . f e a t u r e s " = false ;
" e x t e n s i o n s . h t m l a b o u t a d d o n s . r e c o m m e n d a t i o n s . e n a b l e d " = false ;
" e x t e n s i o n s . h t m l a b o u t a d d o n s . d i s c o v e r . e n a b l e d " = false ;
" e x t e n s i o n s . h t m l a b o u t a d d o n s . i n l i n e - o p t i o n s . e n a b l e d " = false ;
" e x t e n s i o n s . g e t A d d o n s . s h o w P a n e " = false ; # uses Google Analytics
" b r o w s e r . d i s c o v e r y . e n a b l e d " = false ;
2025-02-28 15:46:22 +01:00
2025-03-04 16:57:50 +01:00
# Privacy enhancements
" b r o w s e r . n e w t a b p a g e . a c t i v i t y - s t r e a m . f e e d s . t e l e m e t r y " = false ;
" b r o w s e r . n e w t a b p a g e . a c t i v i t y - s t r e a m . t e l e m e t r y " = false ;
" b r o w s e r . n e w t a b p a g e . a c t i v i t y - s t r e a m . f e e d s . s n i p p e t s " = false ;
" b r o w s e r . n e w t a b p a g e . a c t i v i t y - s t r e a m . f e e d s . s e c t i o n . t o p s t o r i e s " = false ;
" b r o w s e r . n e w t a b p a g e . a c t i v i t y - s t r e a m . s e c t i o n . h i g h l i g h t s . i n c l u d e P o c k e t " = false ;
" b r o w s e r . n e w t a b p a g e . a c t i v i t y - s t r e a m . s h o w S p o n s o r e d " = false ;
" b r o w s e r . n e w t a b p a g e . a c t i v i t y - s t r e a m . f e e d s . d i s c o v e r y s t r e a m f e e d " = false ;
" b r o w s e r . n e w t a b p a g e . a c t i v i t y - s t r e a m . s h o w S p o n s o r e d T o p S i t e s " = false ;
2025-02-28 15:46:22 +01:00
2025-03-04 16:57:50 +01:00
# Improve performance
" g f x . w e b r e n d e r . a l l " = 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).
" b r o w s e r . c o n t e n t b l o c k i n g . c a t e g o r y " = " s t r i c t " ;
" p r i v a c y . p u r g e _ t r a c k e r s . e n a b l e d " = true ;
# Do Not Track header
" p r i v a c y . d o n o t t r a c k h e a d e r . e n a b l e d " = true ;
" p r i v a c y . d o n o t t r a c k h e a d e r . v a l u e " = 1 ;
# Disable Private Attribution Tracking Foo
" d o m . p r i v a t e - a t t r i b u t i o n . s u b m i s s i o n . e n a b l e d " = 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.
" s e r v i c e s . s y n c . p r e f s . s y n c . b r o w s e r . u i C u s t o m i z a t i o n . s t a t e " = true ;
2025-02-28 15:46:22 +01:00
2025-03-04 16:57:50 +01:00
# Enable userChrome customisations
" t o o l k i t . l e g a c y U s e r P r o f i l e C u s t o m i z a t i o n s . s t y l e s h e e t s " = 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.
" b r o w s e r . s e s s i o n s t o r e . i n t e r v a l " = " 9 0 0 0 0 0 " ;
# Disable battery API
" d o m . b a t t e r y . e n a b l e d " = false ;
# Disable "beacon" asynchronous HTTP transfers (used for analytics)
" b e a c o n . e n a b l e d " = false ;
# Disable pinging URIs specified in HTML <a> ping= attributes
" b r o w s e r . s e n d _ p i n g s " = false ;
# Disable gamepad API to prevent USB device enumeration
" d o m . g a m e p a d . e n a b l e d " = false ;
# Don't try to guess domain names when entering an invalid domain name in URL bar
" b r o w s e r . f i x u p . a l t e r n a t e . e n a b l e d " = false ;
2025-02-28 15:46:22 +01:00
2025-03-04 16:57:50 +01:00
# Disable telemetry
" t o o l k i t . t e l e m e t r y . u n i f i e d " = false ;
" t o o l k i t . t e l e m e t r y . e n a b l e d " = false ;
" t o o l k i t . t e l e m e t r y . s e r v e r " = " d a t a : , " ;
" t o o l k i t . t e l e m e t r y . a r c h i v e . e n a b l e d " = false ;
" t o o l k i t . t e l e m e t r y . c o v e r a g e . o p t - o u t " = true ;
" t o o l k i t . c o v e r a g e . o p t - o u t " = true ;
" t o o l k i t . c o v e r a g e . e n d p o i n t . b a s e " = " " ;
" e x p e r i m e n t s . s u p p o r t e d " = false ;
" e x p e r i m e n t s . e n a b l e d " = false ;
" e x p e r i m e n t s . m a n i f e s t . u r i " = " " ;
" b r o w s e r . p i n g - c e n t r e . t e l e m e t r y " = false ;
# https://mozilla.github.io/normandy/
" a p p . n o r m a n d y . e n a b l e d " = false ;
" a p p . n o r m a n d y . a p i _ u r l " = " " ;
" a p p . s h i e l d . o p t o u t s t u d i e s . e n a b l e d " = 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
" d a t a r e p o r t i n g . h e a l t h r e p o r t . u p l o a d E n a b l e d " = false ;
" d a t a r e p o r t i n g . h e a l t h r e p o r t . s e r v i c e . e n a b l e d " = false ;
" d a t a r e p o r t i n g . p o l i c y . d a t a S u b m i s s i o n E n a b l e d " = false ;
2025-02-28 15:46:22 +01:00
2025-03-04 16:57:50 +01:00
# Disable crash reports
" b r e a k p a d . r e p o r t U R L " = " " ;
" b r o w s e r . t a b s . c r a s h R e p o r t i n g . s e n d R e p o r t " = false ;
" b r o w s e r . c r a s h R e p o r t s . u n s u b m i t t e d C h e c k . a u t o S u b m i t 2 " = 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
" b r o w s e r . f o r m f i l l . e n a b l e " = false ;
" e x t e n s i o n s . f o r m a u t o f i l l . a d d r e s s e s . e n a b l e d " = false ;
" e x t e n s i o n s . f o r m a u t o f i l l . a v a i l a b l e " = " o f f " ;
" e x t e n s i o n s . f o r m a u t o f i l l . c r e d i t C a r d s . a v a i l a b l e " = false ;
" e x t e n s i o n s . f o r m a u t o f i l l . c r e d i t C a r d s . e n a b l e d " = false ;
" e x t e n s i o n s . f o r m a u t o f i l l . h e u r i s t i c s . e n a b l e d " = false ;
2025-02-28 15:46:22 +01:00
2025-03-04 16:57:50 +01:00
# VAAPI ffmpeg foo
" m e d i a . f f m p e g . v a a p i . e n a b l e d " = true ;
} ;
2025-02-28 15:46:22 +01:00
2025-03-10 14:09:28 +01:00
extensions . force = true ;
extensions . settings = {
" t a b - s t a s h @ c o n d o r d e s . n e t " . settings = {
options = {
" l a s t _ n o t i f i e d _ v e r s i o n " = " 3 . 2 " ;
" a f t e r _ s t a s h i n g _ t a b " = " c l o s e " ;
" m i g r a t e d _ t a b _ m a r k e r s _ a p p l i e d " = true ;
} ;
} ;
" u B l o c k 0 @ r a y m o n d h i l l . n e t " . settings = {
selectedFilterLists = [
" u s e r - f i l t e r s "
" u b l o c k - f i l t e r s "
" u b l o c k - b a d w a r e "
" u b l o c k - p r i v a c y "
" u b l o c k - q u i c k - f i x e s "
" u b l o c k - u n b r e a k "
" e a s y l i s t "
" e a s y p r i v a c y "
" u r l h a u s - 1 "
" p l o w e - 0 "
" f a n b o y - c o o k i e m o n s t e r "
" u b l o c k - c o o k i e s - e a s y l i s t "
" f a n b o y - s o c i a l "
" e a s y l i s t - c h a t "
" e a s y l i s t - n e w s l e t t e r s "
" e a s y l i s t - n o t i f i c a t i o n s "
" e a s y l i s t - a n n o y a n c e s "
" D E U - 0 "
] ;
} ;
} ;
2025-03-04 16:57:50 +01:00
extensions . packages = with pkgs . nur . repos . rycee . firefox-addons ; [
# clearurls
2025-03-10 12:22:28 +01:00
# leechblock-ng
# localcdn
# skip-redirect
# unpaywall
2025-03-10 14:42:16 +01:00
# privacy-badger
# consent-o-matic
2025-03-10 12:22:28 +01:00
bitwarden
2025-03-04 16:57:50 +01:00
darkreader
dearrow
deutsch-de-language-pack
dictionary-german
df-youtube
flagfox
ipvfoo
kagi-search
plasma-integration
rust-search-extension
sidebery
sponsorblock
tab-stash
ublock-origin
2025-03-10 14:09:28 +01:00
pkgs . nur . repos . bhasherbel . aw-awatcher
2025-03-04 16:57:50 +01:00
] ;
2025-02-28 15:46:22 +01:00
2025-03-10 12:22:28 +01:00
# TODO Reenable when fixed (currently works for setup but default settings is broken due to https://github.com/nix-community/home-manager/pull/6505#issuecomment-2673463728)
# search = {
# force = true;
# default = "Kagi";
# privateDefault = "DuckDuckGo";
# # default = "DuckDuckGo";
# # privateDefault = "Kagi";
# order = [ "Kagi" "DuckDuckGo" "Nix Packages" "Nix Options" "NixOS Wiki" "Home-Manager Options" ];
# engines = {
# "Kagi" = {
# id = "eacf4b1a-4c8a-4b75-abeb-6ae09e5ef4ae";
# urls = [{ template = "https://kagi.com/search?q={searchTerms}"; }];
# definedAliases = [ "@k" ];
# iconUpdateURL = "https://kagi.com/favicon.ico";
# updateInterval = 24 * 60 * 60 * 1000; # every day
# };
# "DuckDuckGo".metaData = {
# alias = "@ddg";
# };
# "Nix Packages" = {
# urls = [
# {
# template = "https://search.nixos.org/packages";
# params = [
# {
# name = "type";
# value = "packages";
# }
# {
# name = "query";
# value = "{searchTerms}";
# }
# ];
# }
# ];
# icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
# definedAliases = [ "@np" ];
# };
# "Nix Options" = {
# urls = [
# {
# template = "https://search.nixos.org/options";
# params = [
# {
# name = "type";
# value = "options";
# }
# {
# name = "query";
# value = "{searchTerms}";
# }
# ];
# }
# ];
# icon = "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
# definedAliases = [ "@no" ];
# };
# "Home-Manager Options" = {
# urls = [
# {
# template = "https://home-manager-options.extranix.com";
# params = [
# {
# name = "query";
# value = "{searchTerms}";
# }
# {
# name = "release";
# value = "master";
# }
# ];
# }
# ];
# 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";
# definedAliases = [ "@nw" ];
# };
# "Bing".metaData.hidden = true;
# "Amazon.de".metaData.hidden = true;
# "Google".metaData.hidden = true;
# };
# };
# TODO Check if possible to reenable without breaking tab stash ?
# This currently overwrites existing bookmarks which kinda sucks.....
# 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
} ;
}