From 6099ce1af413331b5f5d29f0ca4a10ada2850a87 Mon Sep 17 00:00:00 2001 From: caem Date: Sat, 25 Jan 2025 02:35:38 +0100 Subject: [PATCH] no --- modules/nixos/multimedia/web/firefox.nix | 128 ++++++++++++----------- 1 file changed, 67 insertions(+), 61 deletions(-) diff --git a/modules/nixos/multimedia/web/firefox.nix b/modules/nixos/multimedia/web/firefox.nix index f161df1..a1747c9 100644 --- a/modules/nixos/multimedia/web/firefox.nix +++ b/modules/nixos/multimedia/web/firefox.nix @@ -3,6 +3,7 @@ { environment.systemPackages = with pkgs; [ tor-browser + firefox-esr ]; environment.persistence."/nix/config" = { @@ -11,67 +12,72 @@ ]; }; - programs.firefox = { - enable = true; - policies = { - EnableTrackingProtection = { - Value = true; - Cryptomining = true; - Fingerprinting = true; - EmailTracking = true; - Level = "strict"; - }; - DisableTelemetry = true; - DisablePocket = true; - DisableFirefoxStudies = true; - DisableFirefoxAccounts = false; - DisableAccounts = false; - DontCheckDefaultBrowser = true; - OverrideFirstRunPage = ""; - OverridePostUpdatePage = ""; - NoDefaultBookmarks = true; - Cookies = { - Behaviour = "reject-foreign"; - BehaviourPrivateBrowsing = "reject-foreign"; - }; - - UserMessaging = { - WhatsNew = false; - ExtensionRecommendations = false; - FeatureRecommendations = false; - UrlbarInterventions = false; - SkipOnboarding = true; - MoreFromMozilla = false; - }; - - FirefoxHome = { - Search = true; - TopSites = true; - SponsoredTopSites = false; - Highlights = false; - Pocket = false; - SponsoredPocket = false; - Snippets = false; - Locked = true; - }; - - SearchSuggestEnabled = false; - ShowSearchSuggestionsFirst = false; - NewTabPage = false; - - SearchEngines = { # ESR only - Add = [ - { - Name = "Kagi"; - URLTemplate = "https://kagi.com/search?q={searchTerms}"; - Method = "GET"; - IconURL = "https://kagi.com/favicon.ico"; - Alias = "@k"; - Default = true; + environment.etc."firefox/policies/policies.json" = { + mode = "0444"; + text = '' + { + "policies": { + "EnableTrackingProtection": { + "Value": true, + "Cryptomining": true, + "Fingerprinting": true, + "EmailTracking": true, + "Level": "strict" + }, + "DisableTelemetry": true, + "DisablePocket": true, + "DisableFirefoxStudies": true, + "DisableFirefoxAccounts": false, + "DisableAccounts": false, + "DontCheckDefaultBrowser": true, + "OverrideFirstRunPage": "", + "OverridePostUpdatePage": "", + "NoDefaultBookmarks": true, + "Cookies": { + "Behavior": "reject-foreign", + "BehaviorPrivateBrowsing": "reject-foreign" + }, + "UserMessaging": { + "WhatsNew": false, + "ExtensionRecommendations": false, + "FeatureRecommendations": false, + "UrlbarInterventions": false, + "SkipOnboarding": true, + "MoreFromMozilla": false + }, + "FirefoxHome": { + "Search": true, + "TopSites": true, + "SponsoredTopSites": false, + "Highlights": false, + "Pocket": false, + "SponsoredPocket": false, + "Snippets": false, + "Locked": true + }, + "SearchSuggestEnabled": false, + "ShowSearchSuggestionsFirst": false, + "NewTabPage": false, + "SearchEngines": { + "Add": [ + { + "Name": "Kagi", + "URLTemplate": "https://kagi.com/search?q={searchTerms}", + "Method": "GET", + "IconURL": "https://kagi.com/favicon.ico", + "Alias": "@k", + "Default": true + } + ], + "Remove": [ + "Bing", + "Google", + "DuckDuckGo", + "Wikipedia (en)" + ] } - ]; - Remove = [ "Bing" "Google" "DuckDuckGo" "Wikipedia (en)" ]; - }; - }; + } + } + ''; }; }