From c9d99ab3f7f0edb5624f63799c65e75c8faa69f8 Mon Sep 17 00:00:00 2001
From: Kopatz <7265381+Kropatz@users.noreply.github.com>
Date: Mon, 8 Apr 2024 19:32:32 +0200
Subject: [PATCH] add firefox config
---
flake.lock | 18 ++-
flake.nix | 4 +-
home-manager/firefox/config/annoyances.nix | 47 +++++++
.../firefox/config/browser-features.nix | 121 ++++++++++++++++++
home-manager/firefox/config/privacy.nix | 96 ++++++++++++++
home-manager/firefox/config/security.nix | 25 ++++
home-manager/firefox/config/tracking.nix | 69 ++++++++++
home-manager/firefox/default.nix | 56 ++++++++
users/kopatz/home.nix | 1 +
9 files changed, 435 insertions(+), 2 deletions(-)
create mode 100644 home-manager/firefox/config/annoyances.nix
create mode 100644 home-manager/firefox/config/browser-features.nix
create mode 100644 home-manager/firefox/config/privacy.nix
create mode 100644 home-manager/firefox/config/security.nix
create mode 100644 home-manager/firefox/config/tracking.nix
create mode 100644 home-manager/firefox/default.nix
diff --git a/flake.lock b/flake.lock
index 711c6f8..b64b5ba 100644
--- a/flake.lock
+++ b/flake.lock
@@ -275,6 +275,21 @@
"type": "github"
}
},
+ "nur": {
+ "locked": {
+ "lastModified": 1712594810,
+ "narHash": "sha256-YP5daMtfEmbhuZGZbFBjvGQIO0EeVnlhw6L+5IfANws=",
+ "owner": "nix-community",
+ "repo": "NUR",
+ "rev": "8216f5247f695e7648f9735177870071061700f8",
+ "type": "github"
+ },
+ "original": {
+ "owner": "nix-community",
+ "repo": "NUR",
+ "type": "github"
+ }
+ },
"root": {
"inputs": {
"agenix": "agenix",
@@ -284,7 +299,8 @@
"nixos-hardware": "nixos-hardware",
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs_2",
- "nixpkgs-unstable": "nixpkgs-unstable"
+ "nixpkgs-unstable": "nixpkgs-unstable",
+ "nur": "nur"
}
},
"systems": {
diff --git a/flake.nix b/flake.nix
index 706e828..27c58a9 100644
--- a/flake.nix
+++ b/flake.nix
@@ -19,8 +19,10 @@
inputs.nixpkgs.follows = "nixpkgs";
};
nix-colors.url = "github:misterio77/nix-colors";
+ nur = { url = "github:nix-community/NUR"; };
};
outputs = { self,
+ nur,
nixpkgs,
nixos-hardware,
nixos-wsl,
@@ -64,7 +66,7 @@
./users/kopatz
./modules/collections/desktop.nix
./systems/pc/configuration.nix
- ({ config, pkgs, ... }: { nixpkgs.overlays = with outputs.overlays; [additions modifications unstable-packages]; })
+ ({ config, pkgs, ... }: { nixpkgs.overlays = with outputs.overlays; [additions modifications unstable-packages nur.overlay]; })
agenix.nixosModules.default
home-manager-unstable.nixosModules.home-manager
];
diff --git a/home-manager/firefox/config/annoyances.nix b/home-manager/firefox/config/annoyances.nix
new file mode 100644
index 0000000..18eaa39
--- /dev/null
+++ b/home-manager/firefox/config/annoyances.nix
@@ -0,0 +1,47 @@
+{
+ # Disable firefox intro tabs on the first start
+ # Disable the first run tabs with advertisements for the latest firefox features.
+ "browser.startup.homepage_override.mstone" = "ignore";
+ # Disable new tab page intro
+ # Disable the intro to the newtab page on the first run
+ "browser.newtabpage.introShown" = false;
+ # Pocket Reading List
+ # No details
+ "extensions.pocket.enabled" = false;
+ "browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
+ # Disable Sponsored Top Sites
+ # Firefox 83 introduced sponsored top sites
+ # (https://support.mozilla.org/en-US/kb/sponsor-privacy), which are sponsored ads
+ # displayed as suggestions in the URL bar.
+ "services.sync.prefs.sync.browser.newtabpage.activity-stream.showSponsoredTopSite" =
+ false;
+ # Disable about:config warning.
+ # No details
+ "browser.aboutConfig.showWarning" = false;
+ # Do not trim URLs in navigation bar
+ # By default Firefox trims many URLs (hiding the http:// prefix and trailing slash
+ # /).
+ "browser.urlbar.trimURLs" = false;
+ # Disable checking if Firefox is the default browser
+ # No details
+ "browser.shell.checkDefaultBrowser" = false;
+ # Disable reset prompt.
+ # When Firefox is not used for a while, it displays a prompt asking if the user
+ # wants to reset the profile. (see Bug #955950
+ # (https://bugzilla.mozilla.org/show_bug.cgi?id=955950)).
+ "browser.disableResetPrompt" = true;
+ # Disable Heartbeat Userrating
+ # With Firefox 37, Mozilla integrated the Heartbeat
+ # (https://wiki.mozilla.org/Advocacy/heartbeat) system to ask users from time to
+ # time about their experience with Firefox.
+ "browser.selfsupport.url" = "";
+ # Content of the new tab page
+ #
+ "browser.newtabpage.enhanced" = false;
+ # Disable autoplay of <video> tags.
+ # Per default, <video> tags are allowed to start automatically.
+ # Note: When disabling autoplay, you will have to click pause and play again on
+ # some video sites.
+ "media.autoplay.enabled" = true;
+ "media.autoplay.default" = 0;
+}
diff --git a/home-manager/firefox/config/browser-features.nix b/home-manager/firefox/config/browser-features.nix
new file mode 100644
index 0000000..d23444d
--- /dev/null
+++ b/home-manager/firefox/config/browser-features.nix
@@ -0,0 +1,121 @@
+{
+ # Disable Telemetry
+ # The telemetry feature
+ # (https://support.mozilla.org/kb/share-telemetry-data-mozilla-help-improve-firefox)
+ # sends data about the performance and responsiveness of Firefox to Mozilla.
+ "toolkit.telemetry.enabled" = false;
+ "toolkit.telemetry.archive.enabled" = false;
+ "toolkit.telemetry.rejected" = true;
+ "toolkit.telemetry.unified" = false;
+ "toolkit.telemetry.unifiedIsOptIn" = false;
+ "toolkit.telemetry.prompted" = 2;
+ "toolkit.telemetry.server" = "";
+ "toolkit.telemetry.cachedClientID" = "";
+ "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.hybridContent.enabled" = false;
+ "toolkit.telemetry.reportingpolicy.firstRun" = false;
+ # Disable health report
+ # Disable sending Firefox health reports
+ # (https://www.mozilla.org/privacy/firefox/#health-report) to Mozilla
+ "datareporting.healthreport.uploadEnabled" = false;
+ "datareporting.policy.dataSubmissionEnabled" = false;
+ "datareporting.healthreport.service.enabled" = false;
+ # Disable shield studies
+ # Mozilla shield studies (https://wiki.mozilla.org/Firefox/Shield) is a feature
+ # which allows mozilla to remotely install experimental addons.
+ "app.normandy.enabled" = false;
+ "app.normandy.api_url" = "";
+ "app.shield.optoutstudies.enabled" = false;
+ "extensions.shield-recipe-client.enabled" = false;
+ "extensions.shield-recipe-client.api_url" = "";
+ # Disable experiments
+ # Telemetry Experiments (https://wiki.mozilla.org/Telemetry/Experiments) is a
+ # feature that allows Firefox to automatically download and run specially-designed
+ # restartless addons based on certain conditions.
+ "experiments.enabled" = false;
+ "experiments.manifest.uri" = "";
+ "experiments.supported" = false;
+ "experiments.activeExperiment" = false;
+ "network.allow-experiments" = false;
+ # Disable Crash Reports
+ # The crash report (https://www.mozilla.org/privacy/firefox/#crash-reporter) may
+ # contain data that identifies you or is otherwise sensitive to you.
+ "breakpad.reportURL" = "";
+ "browser.tabs.crashReporting.sendReport" = false;
+ "browser.crashReports.unsubmittedCheck.enabled" = false;
+ "browser.crashReports.unsubmittedCheck.autoSubmit" = false;
+ "browser.crashReports.unsubmittedCheck.autoSubmit2" = false;
+ # Opt out metadata updates
+ # Firefox sends data about installed addons as metadata updates
+ # (https://blog.mozilla.org/addons/how-to-opt-out-of-add-on-metadata-updates/), so
+ # Mozilla is able to recommend you other addons.
+ "extensions.getAddons.cache.enabled" = false;
+ # Disable google safebrowsing
+ # Google safebrowsing can detect phishing and malware but it also sends
+ # informations to google together with an unique id called wrkey
+ # (http://electroholiker.de/?p=1594).
+ "browser.safebrowsing.enabled" = false;
+ "browser.safebrowsing.downloads.remote.url" = "";
+ "browser.safebrowsing.phishing.enabled" = false;
+ "browser.safebrowsing.blockedURIs.enabled" = false;
+ "browser.safebrowsing.downloads.enabled" = false;
+ "browser.safebrowsing.downloads.remote.enabled" = false;
+ "browser.safebrowsing.appRepURL" = "";
+ "browser.safebrowsing.malware.enabled" = false;
+ # Disable malware scan
+ # The malware scan sends an unique identifier for each downloaded file to Google.
+ # "browser.safebrowsing.appRepURL" = ""; (Repeated from google safebrowsing)
+ # "browser.safebrowsing.malware.enabled" = false; (Repeated from google safebrowsing)
+ # Disable DNS over HTTPS
+ # DNS over HTTP (DoH), aka. Trusted Recursive Resolver (TRR)
+ # (https://wiki.mozilla.org/Trusted_Recursive_Resolver), uses a server run by
+ # Cloudflare to resolve hostnames, even when the system uses another (normal) DNS
+ # server. This setting disables it and sets the mode to explicit opt-out (5).
+ "network.trr.mode" = 5;
+ # Disable preloading of the new tab page.
+ # By default Firefox preloads the new tab page (with website thumbnails) in the
+ # background before it is even opened.
+ "browser.newtab.preload" = false;
+ # Disable about:addons' Get Add-ons panel
+ # The start page with recommended addons uses google analytics.
+ "extensions.getAddons.showPane" = false;
+ "extensions.webservice.discoverURL" = "";
+ # Disable check for captive portal.
+ # By default, Firefox checks for the presence of a captive portal on every
+ # startup. This involves traffic to Akamai
+ # (https://support.mozilla.org/questions/1169302).
+ "network.captive-portal-service.enabled" = false;
+ # Disables playback of DRM-controlled HTML5 content
+ # if enabled, automatically downloads the Widevine Content Decryption Module
+ # provided by Google Inc. Details
+ # (https://support.mozilla.org/en-US/kb/enable-drm#w_opt-out-of-cdm-playback-uninstall-cdms-and-stop-all-cdm-downloads)
+ "media.eme.enabled" = false;
+ # Disables the Widevine Content Decryption Module provided by Google Inc.
+ # Used for the playback of DRM-controlled HTML5 content Details
+ # (https://support.mozilla.org/en-US/kb/enable-drm#w_disable-the-google-widevine-cdm-without-uninstalling)
+ "media.gmp-widevinecdm.enabled" = false;
+ # Disable access to device sensor data
+ # Disallow websites to access sensor data (ambient light, motion, device
+ # orientation and proximity data).
+ "device.sensors.ambientLight.enabled" = false;
+ "device.sensors.enabled" = false;
+ "device.sensors.motion.enabled" = false;
+ "device.sensors.orientation.enabled" = false;
+ "device.sensors.proximity.enabled" = false;
+ # Disable Firefox Suggest
+ # The Firefox Suggest
+ # (https://support.mozilla.org/en-US/kb/navigate-web-faster-firefox-suggest)
+ # feature allows Mozilla to provide search suggestions in the US, which uses your
+ # city location and search keywords to send suggestions. This is also used to
+ # serve advertisements.
+ "browser.urlbar.groupLabels.enabled" = false;
+ "browser.urlbar.quicksuggest.enabled" = false;
+ # Disable Javascript in PDF viewer
+ # Disables executing of JavaScript in the PDF form viewer. It is possible that
+ # some PDFs are not rendered correctly due to missing functions.
+ "pdfjs.enableScripting" = true;
+}
diff --git a/home-manager/firefox/config/privacy.nix b/home-manager/firefox/config/privacy.nix
new file mode 100644
index 0000000..3e04d74
--- /dev/null
+++ b/home-manager/firefox/config/privacy.nix
@@ -0,0 +1,96 @@
+{
+ # Fake another Useragent
+ # Using a popular useragent string
+ # (https://techblog.willshouse.com/2012/01/03/most-common-user-agents/) avoids
+ # attracting attention i.e. with an Iceweasel UA. (keep blank to use the default)
+
+ # Block Cookies
+ # Block 3rd-Party cookies or even all cookies.
+ "network.cookie.cookieBehavior" = 1;
+ # Block Referer
+ # Firefox tells a website, from which site you're coming (the so called RefControl
+ # (http://kb.mozillazine.org/Network.http.sendRefererHeader">referer). You can
+ # find more detailed settings in this ghacks
+ # article or install the IndexedDB is a way,
+ # websites can store structured data. This can be fingerprinting with WebGL. Another
+ # issue is, that websites can Caution: When you
+ # disable the blocklist, you may keep using known malware addons.
+ "extensions.blocklist.enabled" = false;
+ # Enable HTTPS only mode
+ # If enabled, allows connections only to sites that use the HTTPS protocol.
+ "dom.security.https_only_mode" = true;
+ "dom.security.https_only_mode_ever_enabled" = true;
+ # Show Punycode.
+ # This helps to protect against possible character spoofing.
+ "network.IDN_show_punycode" = true;
+}
diff --git a/home-manager/firefox/config/tracking.nix b/home-manager/firefox/config/tracking.nix
new file mode 100644
index 0000000..9271896
--- /dev/null
+++ b/home-manager/firefox/config/tracking.nix
@@ -0,0 +1,69 @@
+{
+ # Enable Do-not-Track
+ # With the do not track feature, you tell websites, that you do not want to be
+ # tracked. Most websites ignore this, so you need other privacy options as well.
+ "privacy.donottrackheader.enabled" = true;
+ "privacy.donottrackheader.value" = 1;
+ # Enable resistFingerprinting
+ # The privacy.resistFingerprinting setting coming from the
+ # tor-browser hides some system properties. See discussion in our bug tracker.
+ # (https://bugzilla.mozilla.org/show_bug.cgi?id=1308340">Bug #1308340 for more
+ # information. This option may interfere with other privacy related settings, see
+ # the