From e91096db26ef8bc22be19668f84e59dabf1d2a14 Mon Sep 17 00:00:00 2001 From: Nexoniarz Date: Fri, 2 Oct 2026 20:47:52 +0200 Subject: [PATCH] Add configs/ folder: Firefox prefs via autoconfig, Gruvbox fastfetch Co-Authored-By: Claude Opus 5.5 --- README.md | 3 + configs/fastfetch/config.jsonc | 80 ++++++++++++++++++++++ configs/firefox/prefs.js | 120 +++++++++++++++++++++++++++++++++ configuration.nix | 2 + modules/fastfetch.nix | 7 ++ modules/firefox.nix | 11 +++ modules/users.nix | 1 - 7 files changed, 223 insertions(+), 1 deletion(-) create mode 100644 configs/fastfetch/config.jsonc create mode 100644 configs/firefox/prefs.js create mode 100644 modules/fastfetch.nix create mode 100644 modules/firefox.nix diff --git a/README.md b/README.md index 6348c5f..89c032f 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,9 @@ My personal NixOS system configuration. | `modules/apps.nix` | Installed packages, nix-ld | | `modules/default-apps.nix` | MIME associations | | `modules/scripts.nix` | Custom scripts in `modules/scripts/` | +| `modules/fastfetch.nix` | Installs `configs/fastfetch/config.jsonc` system-wide | +| `modules/firefox.nix` | Firefox, with prefs from `configs/firefox/prefs.js` (reapplied each start, not locked) | +| `configs/` | Plain app config files (Firefox prefs, fastfetch) used by the modules | --- diff --git a/configs/fastfetch/config.jsonc b/configs/fastfetch/config.jsonc new file mode 100644 index 0000000..8cf04e2 --- /dev/null +++ b/configs/fastfetch/config.jsonc @@ -0,0 +1,80 @@ +// Gruvbox-themed fastfetch, matching the Limine and icon theme. +// Colors: yellow fabd2f, aqua 8ec07c, blue 83a598, orange fe8019, gray 928374. +{ + "$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json", + "logo": { + "source": "nixos", + "color": { + "1": "38;2;131;165;152", + "2": "38;2;142;192;124", + "3": "38;2;131;165;152", + "4": "38;2;142;192;124", + "5": "38;2;131;165;152", + "6": "38;2;142;192;124" + }, + "padding": { "top": 1, "left": 1, "right": 3 } + }, + "display": { + "separator": " ", + "color": { + "keys": "38;2;250;189;47", + "title": "38;2;254;128;25", + "output": "38;2;235;219;178" + }, + "key": { "width": 13 }, + "bar": { + "char": { "elapsed": "■", "total": "■" }, + "border": { "left": "", "right": "" }, + "color": { "total": "38;2;80;73;69" }, + "width": 12 + }, + "percent": { + "type": ["num", "bar"], + "color": { + "green": "38;2;184;187;38", + "yellow": "38;2;250;189;47", + "red": "38;2;251;73;52" + } + }, + "size": { "binaryPrefix": "iec", "ndigits": 1 } + }, + "modules": [ + { + "type": "title", + "format": "{#1}󱄅 {#38;2;254;128;25}{user-name}{#38;2;146;131;116}@{#38;2;142;192;124}{host-name}" + }, + { + "type": "custom", + "format": "{#38;2;146;131;116}╭─────────────── {#38;2;131;165;152}system{#38;2;146;131;116} ───────────────" + }, + { "type": "os", "key": "│ 󱄅 os", "keyColor": "38;2;131;165;152", "format": "{pretty-name}" }, + { "type": "kernel", "key": "│ 󰌽 kernel", "keyColor": "38;2;131;165;152" }, + { "type": "packages", "key": "│ 󰏖 pkgs", "keyColor": "38;2;131;165;152", "format": "{nix-system} sys · {nix-user} user · {flatpak-all} flatpak" }, + { "type": "uptime", "key": "│ 󰔟 uptime", "keyColor": "38;2;131;165;152" }, + { "type": "shell", "key": "│ 󰆍 shell", "keyColor": "38;2;131;165;152" }, + { + "type": "custom", + "format": "{#38;2;146;131;116}├─────────────── {#38;2;142;192;124}desktop{#38;2;146;131;116} ──────────────" + }, + { "type": "de", "key": "│ 󰕮 de", "keyColor": "38;2;142;192;124" }, + { "type": "wm", "key": "│ 󰖲 wm", "keyColor": "38;2;142;192;124" }, + { "type": "icons", "key": "│ 󰀻 icons", "keyColor": "38;2;142;192;124", "format": "{1}" }, + { "type": "cursor", "key": "│ 󰇀 cursor", "keyColor": "38;2;142;192;124" }, + { + "type": "custom", + "format": "{#38;2;146;131;116}├─────────────── {#38;2;254;128;25}hardware{#38;2;146;131;116} ─────────────" + }, + { "type": "host", "key": "│ 󰍹 board", "keyColor": "38;2;254;128;25" }, + { "type": "cpu", "key": "│ 󰻠 cpu", "keyColor": "38;2;254;128;25", "temp": true, "format": "{name} ({cores-logical}) @ {freq-max}" }, + { "type": "gpu", "key": "│ 󰢮 gpu", "keyColor": "38;2;254;128;25", "format": "{name}" }, + { "type": "display", "key": "│ 󰍺 display","keyColor": "38;2;254;128;25", "format": "{width}x{height} @ {refresh-rate} Hz" }, + { "type": "memory", "key": "│ 󰑭 ram", "keyColor": "38;2;254;128;25", "format": "{percentage-bar} {used} / {total} ({percentage})" }, + { "type": "disk", "key": "│ 󰋊 disk", "keyColor": "38;2;254;128;25", "folders": "/", "format": "{size-percentage-bar} {size-used} / {size-total} ({size-percentage})" }, + { + "type": "custom", + "format": "{#38;2;146;131;116}╰──────────────────────────────────────────" + }, + "break", + { "type": "colors", "symbol": "circle", "paddingLeft": 2 } + ] +} diff --git a/configs/firefox/prefs.js b/configs/firefox/prefs.js new file mode 100644 index 0000000..4de99cb --- /dev/null +++ b/configs/firefox/prefs.js @@ -0,0 +1,120 @@ +// Nexoniarz's Firefox prefs (Firefox 157, "Nova" design) +// +// Loaded by NixOS (modules/firefox.nix) into Firefox's autoconfig. pref() +// sets the value on every Firefox start but doesn't lock it: you can still +// change things in Settings/about:config, they just reset on next start. +// To change a setting permanently, edit it here and nixos-rebuild. +// To stop managing a setting, delete its line (Firefox then keeps +// whatever value it last had). +// +// GPU video decoding also needs env vars set in modules/hardware.nix: +// LIBVA_DRIVER_NAME=nvidia NVD_BACKEND=direct MOZ_DISABLE_RDD_SANDBOX=1 + +/*** PRIVACY: tracking & fingerprinting ***/ + +// Strict Enhanced Tracking Protection: blocks trackers, cryptominers and +// known fingerprinters, isolates cookies per site (Total Cookie Protection), +// strips tracking parameters from URLs, and turns on fingerprintingProtection +// (randomized canvas, fewer exposed hardware details). +// If a site breaks: click the shield in the address bar and turn it off +// for that site only. +pref("browser.contentblocking.category", "strict"); + +// resistFingerprinting replaced by the fingerprintingProtection above. RFP +// forced light mode, UTC time and English pages on every site. +pref("privacy.resistFingerprinting", false); +pref("privacy.spoof_english", 0); +// Old first-party isolation; Total Cookie Protection replaces it and breaks +// far fewer cross-site logins. +pref("privacy.firstparty.isolate", false); + +// Cross-site requests only send the origin (https://site.com/), not the +// full page URL you came from. +pref("network.http.referer.XOriginTrimmingPolicy", 2); + +// Tell sites not to sell/share your data (legally binding in some places). +pref("privacy.globalprivacycontrol.enabled", true); + +// No WebRTC: stops IP leaks. Web video calls (Meet, Discord in-browser) +// need this set to true. +pref("media.peerconnection.enabled", false); + +/*** PRIVACY: Mozilla data collection ***/ + +pref("datareporting.healthreport.uploadEnabled", false); +pref("datareporting.policy.dataSubmissionEnabled", false); +pref("datareporting.usage.uploadEnabled", false); +pref("toolkit.telemetry.enabled", false); +pref("toolkit.telemetry.unified", false); +pref("app.shield.optoutstudies.enabled", false); +pref("app.normandy.enabled", false); +pref("nimbus.rollouts.enabled", false); +pref("browser.discovery.enabled", false); + +// Firefox Suggest launched in Poland with Firefox 157; it adds sponsored +// results to the address bar. +pref("browser.urlbar.quicksuggest.enabled", false); +pref("browser.urlbar.suggest.quicksuggest.sponsored", false); +pref("browser.urlbar.suggest.quicksuggest.nonsponsored", false); +pref("browser.newtabpage.activity-stream.showSponsored", false); +pref("browser.newtabpage.activity-stream.showSponsoredTopSites", false); + +/*** SECURITY ***/ + +// HTTPS-Only: upgrade every site to HTTPS and warn before loading plain +// HTTP. Was enabled once, but it's off now. +pref("dom.security.https_only_mode", true); + +// Safe Browsing back on for malware/phishing. It checks a local list and +// only sends a partial hash when a URL matches, never your history. +// The remote download check (which uploads file metadata to Google) stays off. +pref("browser.safebrowsing.malware.enabled", true); +pref("browser.safebrowsing.phishing.enabled", true); +pref("browser.safebrowsing.downloads.enabled", true); +pref("browser.safebrowsing.downloads.remote.enabled", false); + +/*** NETWORK ***/ + +// DNS: use the system resolver (systemd-resolved with DNS-over-TLS) and +// never let Firefox switch itself to its own DNS-over-HTTPS provider. +pref("network.trr.mode", 5); + +// No preloading pages or DNS you didn't ask for. +pref("network.dns.disablePrefetch", true); +pref("network.prefetch-next", false); +pref("network.http.speculative-parallel-limit", 0); +pref("browser.urlbar.speculativeConnect.enabled", false); +pref("network.captive-portal-service.enabled", false); +pref("network.connectivity-service.enabled", false); + +/*** GPU VIDEO DECODING (RTX 3060 Ti, nvidia-vaapi-driver) ***/ + +// Firefox blocklists VA-API on NVIDIA; force it on. The 3060 Ti decodes +// H.264, VP9 and AV1 in hardware. (media.ffmpeg.vaapi.enabled is gone +// since Firefox 137; this pref replaced it.) +pref("media.hardware-video-decoding.force-enabled", true); +pref("media.rdd-ffmpeg.enabled", true); +pref("gfx.webrender.all", true); + +/*** LOOK & FEEL ***/ + +// Compact mode (back in Firefox 157): thinner tabs and toolbars. +// Switch back via ☰ > More tools > Customize toolbar > Density. +pref("browser.compactmode.show", true); +pref("browser.uidensity", 1); + +// Smoother, momentum-based scrolling, nicer at 240 Hz. +pref("general.smoothScroll.msdPhysics.enabled", true); + +// Middle-click on a page to autoscroll (like on Windows). +pref("general.autoScroll", true); + +// Closing the last tab doesn't close the window. +pref("browser.tabs.closeWindowWithLastTab", false); + +// Show the full URL including https:// so you always see what site you're on. +pref("browser.urlbar.trimHttps", false); +pref("browser.urlbar.trimURLs", false); + +// No "proceed with caution" page every time you open about:config. +pref("browser.aboutConfig.showWarning", false); diff --git a/configuration.nix b/configuration.nix index abdbb21..56ab189 100644 --- a/configuration.nix +++ b/configuration.nix @@ -21,6 +21,8 @@ ./modules/apps.nix ./modules/default-apps.nix ./modules/scripts.nix + ./modules/fastfetch.nix + ./modules/firefox.nix ]; # Do not change this value. Read documentation before updating. diff --git a/modules/fastfetch.nix b/modules/fastfetch.nix new file mode 100644 index 0000000..9fc70ce --- /dev/null +++ b/modules/fastfetch.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: + +{ + # System-wide config; fastfetch searches /etc/xdg/fastfetch/ after + # ~/.config/fastfetch/, so a user config there would still win. + environment.etc."xdg/fastfetch/config.jsonc".source = ../configs/fastfetch/config.jsonc; +} diff --git a/modules/firefox.nix b/modules/firefox.nix new file mode 100644 index 0000000..71ee5ea --- /dev/null +++ b/modules/firefox.nix @@ -0,0 +1,11 @@ +{ config, pkgs, ... }: + +{ + programs.firefox = { + enable = true; + # Not locked: values are reapplied on every Firefox start, but can be + # changed in the UI for the current session. (Read as text: the module + # doesn't copy autoConfigFiles paths into the store.) + autoConfig = builtins.readFile ../configs/firefox/prefs.js; + }; +} diff --git a/modules/users.nix b/modules/users.nix index 121d6f5..e2e28eb 100644 --- a/modules/users.nix +++ b/modules/users.nix @@ -9,7 +9,6 @@ }; programs.zsh.enable = true; - programs.firefox.enable = true; programs.steam = { enable = true;