From 08e25c159d9d948a66488b807d9f30712ef9d2b6 Mon Sep 17 00:00:00 2001 From: adikro Date: Sun, 22 Mar 2026 17:05:46 +0100 Subject: librewolf stuff --- flake.lock | 97 ++++++++++- flake.nix | 5 + hm/soft/browser.nix | 183 +++++++++++++++++++++ hm/soft/librewolf/browser.nix | 176 -------------------- hm/soft/librewolf/extensions/keepass-tusk.nix | 20 --- hm/soft/librewolf/extensions/popup-blocker.nix | 20 --- .../librewolf/extensions/user-agent-switcher.nix | 20 --- hm/soft/soft.nix | 2 +- hosts/thinkpad/configuration.nix | 6 +- os/srv/omnisearch.nix | 1 + 10 files changed, 286 insertions(+), 244 deletions(-) create mode 100644 hm/soft/browser.nix delete mode 100644 hm/soft/librewolf/browser.nix delete mode 100644 hm/soft/librewolf/extensions/keepass-tusk.nix delete mode 100644 hm/soft/librewolf/extensions/popup-blocker.nix delete mode 100644 hm/soft/librewolf/extensions/user-agent-switcher.nix diff --git a/flake.lock b/flake.lock index d9d3656..67c538e 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,27 @@ { "nodes": { + "arkenfox": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": [ + "nixpkgs" + ], + "pre-commit": "pre-commit" + }, + "locked": { + "lastModified": 1770200864, + "narHash": "sha256-COdM5Lwfw07Q+YefYmcop1VPEX7e2goM9IiwfIrJt0g=", + "owner": "dwarfmaster", + "repo": "arkenfox-nixos", + "rev": "94638bbfacfa250e5c88aaa7a8f2145926fb8e08", + "type": "github" + }, + "original": { + "owner": "dwarfmaster", + "repo": "arkenfox-nixos", + "type": "github" + } + }, "disko": { "inputs": { "nixpkgs": [ @@ -45,6 +67,22 @@ } }, "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1767039857, + "narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { "locked": { "lastModified": 1733328505, "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", @@ -58,7 +96,7 @@ "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" } }, - "flake-compat_2": { + "flake-compat_3": { "flake": false, "locked": { "lastModified": 1751685974, @@ -74,7 +112,7 @@ "url": "https://git.lix.systems/lix-project/flake-compat.git" } }, - "flake-compat_3": { + "flake-compat_4": { "flake": false, "locked": { "lastModified": 1767039857, @@ -268,6 +306,28 @@ "type": "github" } }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "arkenfox", + "pre-commit", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -464,7 +524,7 @@ }, "nixcord": { "inputs": { - "flake-compat": "flake-compat", + "flake-compat": "flake-compat_2", "flake-parts": "flake-parts_2", "nixpkgs": [ "nixpkgs" @@ -670,7 +730,7 @@ }, "nvf": { "inputs": { - "flake-compat": "flake-compat_2", + "flake-compat": "flake-compat_3", "flake-parts": "flake-parts_5", "mnw": "mnw", "ndg": "ndg", @@ -716,8 +776,35 @@ "type": "github" } }, + "pre-commit": { + "inputs": { + "flake-compat": [ + "arkenfox", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "arkenfox", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1769939035, + "narHash": "sha256-Fok2AmefgVA0+eprw2NDwqKkPGEI5wvR+twiZagBvrg=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "a8ca480175326551d6c4121498316261cbb5b260", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, "root": { "inputs": { + "arkenfox": "arkenfox", "disko": "disko", "fsel": "fsel", "home-manager": "home-manager", @@ -947,7 +1034,7 @@ }, "waybar": { "inputs": { - "flake-compat": "flake-compat_3", + "flake-compat": "flake-compat_4", "nixpkgs": [ "nixpkgs" ] diff --git a/flake.nix b/flake.nix index 9c4e243..dcddee3 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,11 @@ # inputs.nixpkgs.follows = "nixpkgs"; # }; + arkenfox = { + url = "github:dwarfmaster/arkenfox-nixos"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/hm/soft/browser.nix b/hm/soft/browser.nix new file mode 100644 index 0000000..c5184fe --- /dev/null +++ b/hm/soft/browser.nix @@ -0,0 +1,183 @@ +{ + config, + lib, + pkgs, + inputs, + ... +}: +let + cfg = config.hm.soft.browser; +in +{ + options.hm.soft.browser = { + librewolf.enable = lib.mkEnableOption "LibreWolf browser"; + brave.enable = lib.mkEnableOption "Brave browser"; + }; + imports = [ inputs.arkenfox.hmModules.arkenfox ]; + config = lib.mkMerge [ + (lib.mkIf cfg.librewolf.enable { + programs.librewolf = { + enable = true; + # arkenfox = { + # enable = true; + # version = "148.0.2-2"; + # }; + settings = { + "toolkit.legacyUserProfileCustomizations.stylesheets" = true; + }; + + profiles = { + main = { + id = 0; + name = "main"; + isDefault = true; + search = { + force = true; + engines = { + "google".metaData.hidden = true; + "bing".metaData.hidden = true; + # "ddg".metaData.hidden = true; + "perplexity".metaData.hidden = true; + "wikipedia".metaData.hidden = true; + "policy-DuckDuckGo Lite".metaData.hidden = true; + "policy-Searx Belgium".metaData.hidden = true; + "policy-MetaGer".metaData.hidden = true; + "policy-Startpage".metaData.hidden = true; + "policy-Mojeek".metaData.hidden = true; + + "OmniSearch" = { + urls = [ { template = "http://omnisearch.local:8087/search?q={searchTerms}"; } ]; + definedAliases = [ "@omni" ]; + }; + "SearXNG" = { + urls = [ { template = "https://sxng.violets-purgatory.dev/search?q={searchTerms}"; } ]; + definedAliases = [ "@s" ]; + }; + "NixOS Packages" = { + urls = [ { template = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}"; } ]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; + "NixOS Options" = { + urls = [ { template = "https://search.nixos.org/options?channel=unstable&query={searchTerms}"; } ]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@no" ]; + }; + "Home Manager Options" = { + urls = [ + { template = "https://home-manager-options.extranix.com/?query={searchTerms}&release=master"; } + ]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@hm" ]; + }; + }; + }; + extensions = { + force = true; + packages = with pkgs.nur.repos.rycee.firefox-addons; [ + vimium + sidebery + bitwarden + buster-captcha-solver + sponsorblock + dearrow + darkreader + i-dont-care-about-cookies + keepassxc-browser + ]; + }; + settings = { + "identity.fxaccounts.enabled" = true; + "extensions.autoDisableScopes" = 0; + # --- Privacy & Fingerprinting --- + "privacy.resistFingerprinting" = true; + "privacy.fingerprintingProtection" = true; + "privacy.query_stripping.enabled" = true; + "privacy.query_stripping.enabled.pbmode" = true; + "privacy.trackingprotection.enabled" = true; + "privacy.trackingprotection.socialtracking.enabled" = true; + "privacy.trackingprotection.emailtracking.enabled" = true; + "privacy.bounceTrackingProtection.mode" = 1; + "privacy.annotate_channels.strict_list.enabled" = true; + "privacy.clearOnShutdown_v2.formdata" = true; + + # --- Data Collection & Form Security --- + "dom.forms.autocomplete.formautofill" = false; + "signon.management.page.breach-alerts.enabled" = false; + "browser.translations.enable" = false; + "browser.region.update.enabled" = false; + + # --- Search & URL Bar --- + "browser.urlbar.shortcuts.bookmarks" = false; + "browser.urlbar.shortcuts.history" = false; + "browser.urlbar.shortcuts.tabs" = false; + "browser.urlbar.shortcuts.actions" = false; + "browser.urlbar.showSearchTerms.enabled" = false; + + # --- Networking & Performance --- + "network.proxy.type" = 0; + "network.prefetch-next" = false; + "network.predictor.enabled" = false; + "network.http.speculative-parallel-limit" = 0; + "network.early-hints.preconnect.max_connections" = 0; + "network.connectivity-service.enabled" = false; + "network.captive-portal-service.enabled" = false; + "security.tls.enable_0rtt_data" = false; + + # --- Interface & De-clutter --- + "browser.startup.page" = 3; + "browser.startup.homepage" = "chrome://browser/content/blanktab.html"; + "browser.newtabpage.enabled" = false; + "browser.newtabpage.activity-stream.showSearch" = false; + "browser.newtabpage.activity-stream.showSponsoredCheckboxes" = false; + "browser.bookmarks.restore_default_bookmarks" = false; + "media.hardwaremediakeys.enabled" = false; + "media.videocontrols.picture-in-picture.video-toggle.enabled" = false; + "layout.spellcheckDefault" = 0; + + # --- Safe Browsing (Privacy Trade-off) --- + "browser.safebrowsing.downloads.remote.enabled" = false; + "browser.safebrowsing.downloads.remote.block_potentially_unwanted" = false; + "browser.safebrowsing.downloads.remote.block_uncommon" = false; + }; + userChrome = '' + #TabsToolbar { visibility: collapse !important; } + #sidebar-header { display: none !important; } + #toolbar-menubar { display: none !important; } + ''; + }; + privacy = { + id = 1; + name = "I2P"; + settings = { + "media.peerconnection.enabled" = false; + "network.proxy.type" = 1; + + "network.proxy.http" = "127.0.0.1"; + "network.proxy.http_port" = 4444; + + "network.proxy.ssl" = "127.0.0.1"; + "network.proxy.ssl_port" = 4444; + + "network.proxy.no_proxies_on" = "localhost, 127.0.0.1"; + + "network.http.proxy.pipelining" = true; + "network.proxy.share_proxy_settings" = true; + + "network.prefetch-next" = false; + "network.dns.disablePrefetch" = true; + }; + userChrome = '' + #TabsToolbar { visibility: collapse !important; } + #sidebar-header { display: none !important; } + #toolbar-menubar { display: none !important; } + ''; + }; + }; + }; + }) + (lib.mkIf cfg.brave.enable { + home.packages = [ pkgs.brave ]; + }) + ]; +} diff --git a/hm/soft/librewolf/browser.nix b/hm/soft/librewolf/browser.nix deleted file mode 100644 index b67d71f..0000000 --- a/hm/soft/librewolf/browser.nix +++ /dev/null @@ -1,176 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -let - cfg = config.hm.soft.browser; -in -{ - options.hm.soft.browser = { - librewolf.enable = lib.mkEnableOption "LibreWolf browser"; - brave.enable = lib.mkEnableOption "Brave browser"; - }; - config = lib.mkMerge [ - (lib.mkIf cfg.librewolf.enable { - programs.librewolf = { - enable = true; - settings = { - "toolkit.legacyUserProfileCustomizations.stylesheets" = true; - }; - - profiles = { - main = { - id = 0; - name = "main"; - isDefault = true; - search = { - force = true; - engines = { - "SearXNG" = { - urls = [ { template = "https://sxng.violets-purgatory.dev/search?q={searchTerms}"; } ]; - definedAliases = [ "@s" ]; - }; - "NixOS Packages" = { - urls = [ { template = "https://search.nixos.org/packages?channel=unstable&query={searchTerms}"; } ]; - icon = ""; - definedAliases = [ "@np" ]; - }; - "NixOS Options" = { - urls = [ { template = "https://search.nixos.org/options?channel=unstable&query={searchTerms}"; } ]; - icon = ""; - definedAliases = [ "@no" ]; - }; - "Home Manager Options" = { - urls = [ - { template = "https://home-manager-options.extranix.com/?query={searchTerms}&release=master"; } - ]; - definedAliases = [ "@hm" ]; - }; - }; - }; - extensions = { - force = true; - packages = with pkgs.nur.repos.rycee.firefox-addons; [ - (pkgs.callPackage ./extensions/keepass-tusk.nix { }) - (pkgs.callPackage ./extensions/popup-blocker.nix { }) - (pkgs.callPackage ./extensions/user-agent-switcher.nix { }) - link-cleaner - privacy-badger - to-deepl - vimium - link-cleaner - languagetool - sidebery - bitwarden - buster-captcha-solver - sponsorblock - dearrow - darkreader - violentmonkey - i-dont-care-about-cookies - keepassxc-browser - noscript - privacy-settings - protondb-for-steam - steam-database - terms-of-service-didnt-read - unpaywall - ]; - }; - settings = { - "identity.fxaccounts.enabled" = true; - - # --- Privacy & Fingerprinting --- - "privacy.resistFingerprinting" = true; - "privacy.fingerprintingProtection" = true; - "privacy.query_stripping.enabled" = true; - "privacy.query_stripping.enabled.pbmode" = true; - "privacy.trackingprotection.enabled" = true; - "privacy.trackingprotection.socialtracking.enabled" = true; - "privacy.trackingprotection.emailtracking.enabled" = true; - "privacy.bounceTrackingProtection.mode" = 1; - "privacy.annotate_channels.strict_list.enabled" = true; - "privacy.clearOnShutdown_v2.formdata" = true; - - # --- Data Collection & Form Security --- - "dom.forms.autocomplete.formautofill" = false; - "signon.management.page.breach-alerts.enabled" = false; - "browser.translations.enable" = false; - "browser.region.update.enabled" = false; - - # --- Search & URL Bar --- - "browser.urlbar.shortcuts.bookmarks" = false; - "browser.urlbar.shortcuts.history" = false; - "browser.urlbar.shortcuts.tabs" = false; - "browser.urlbar.shortcuts.actions" = false; - "browser.urlbar.showSearchTerms.enabled" = false; - - # --- Networking & Performance --- - "network.proxy.type" = 0; - "network.prefetch-next" = false; - "network.predictor.enabled" = false; - "network.http.speculative-parallel-limit" = 0; - "network.early-hints.preconnect.max_connections" = 0; - "network.connectivity-service.enabled" = false; - "network.captive-portal-service.enabled" = false; - "security.tls.enable_0rtt_data" = false; - - # --- Interface & De-clutter --- - "browser.startup.page" = 3; - "browser.startup.homepage" = "chrome://browser/content/blanktab.html"; - "browser.newtabpage.enabled" = false; - "browser.newtabpage.activity-stream.showSearch" = false; - "browser.newtabpage.activity-stream.showSponsoredCheckboxes" = false; - "browser.bookmarks.restore_default_bookmarks" = false; - "media.hardwaremediakeys.enabled" = false; - "media.videocontrols.picture-in-picture.video-toggle.enabled" = false; - "layout.spellcheckDefault" = 0; - - # --- Safe Browsing (Privacy Trade-off) --- - "browser.safebrowsing.downloads.remote.enabled" = false; - "browser.safebrowsing.downloads.remote.block_potentially_unwanted" = false; - "browser.safebrowsing.downloads.remote.block_uncommon" = false; - }; - userChrome = '' - #TabsToolbar { visibility: collapse !important; } - #sidebar-header { display: none !important; } - #toolbar-menubar { display: none !important; } - ''; - }; - privacy = { - id = 1; - name = "privacy"; - settings = { - "media.peerconnection.enabled" = false; - "network.proxy.type" = 1; - - "network.proxy.http" = "127.0.0.1"; - "network.proxy.http_port" = 4444; - - "network.proxy.ssl" = "127.0.0.1"; - "network.proxy.ssl_port" = 4444; - - "network.proxy.no_proxies_on" = "localhost, 127.0.0.1"; - - "network.http.proxy.pipelining" = true; - "network.proxy.share_proxy_settings" = true; - - "network.prefetch-next" = false; - "network.dns.disablePrefetch" = true; - }; - userChrome = '' - #TabsToolbar { visibility: collapse !important; } - #sidebar-header { display: none !important; } - #toolbar-menubar { display: none !important; } - ''; - }; - }; - }; - }) - (lib.mkIf cfg.brave.enable { - home.packages = [ pkgs.brave ]; - }) - ]; -} diff --git a/hm/soft/librewolf/extensions/keepass-tusk.nix b/hm/soft/librewolf/extensions/keepass-tusk.nix deleted file mode 100644 index e197cb9..0000000 --- a/hm/soft/librewolf/extensions/keepass-tusk.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ stdenv, fetchurl }: - -stdenv.mkDerivation rec { - pname = "KeePass Tusk - Password Access and Autofill"; - version = "2024.8.20"; - - src = fetchurl { - url = "https://addons.mozilla.org/firefox/downloads/file/4340608/keepass_tusk-${version}.xpi"; - sha256 = "sha256-RaViUTzo+JOmgnUB1cr4cCb1AEI2QDiR0frxYCpi8oE="; - }; - - dontUnpack = true; - - addonId = "brandon@subdavis.com"; - - installPhase = '' - mkdir -p $out - cp $src $out/${addonId}.xpi - ''; -} diff --git a/hm/soft/librewolf/extensions/popup-blocker.nix b/hm/soft/librewolf/extensions/popup-blocker.nix deleted file mode 100644 index f1fe451..0000000 --- a/hm/soft/librewolf/extensions/popup-blocker.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ stdenv, fetchurl }: - -stdenv.mkDerivation rec { - pname = "Popup Blocker (strict)"; - version = "0.9.1"; - - src = fetchurl { - url = "https://addons.mozilla.org/firefox/downloads/file/4674849/popup_blocker-${version}.xpi"; - sha256 = "sha256-Zw9jUeP8r+FhMuK23Xwelb9NOXawqYs4pZx0oVbVLOs="; - }; - - dontUnpack = true; - - addonId = "{de22fd49-c9ab-4359-b722-b3febdc3a0b0}"; - - installPhase = '' - mkdir -p $out - cp $src $out/${addonId}.xpi - ''; -} diff --git a/hm/soft/librewolf/extensions/user-agent-switcher.nix b/hm/soft/librewolf/extensions/user-agent-switcher.nix deleted file mode 100644 index 5168ead..0000000 --- a/hm/soft/librewolf/extensions/user-agent-switcher.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ stdenv, fetchurl }: - -stdenv.mkDerivation rec { - pname = "User-Agent Switcher and Manager"; - version = "0.6.6"; - - src = fetchurl { - url = "https://addons.mozilla.org/firefox/downloads/file/4593736/user_agent_string_switcher-${version}.xpi"; - sha256 = "sha256-nB/uKb2JpyH3r412qZeqytAn1PKxQc2wQ+6QJ7iWdZk="; - }; - - dontUnpack = true; - - addonId = "{a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7}"; - - installPhase = '' - mkdir -p $out - cp $src $out/${addonId}.xpi - ''; -} diff --git a/hm/soft/soft.nix b/hm/soft/soft.nix index 80a0c04..f6a9a69 100644 --- a/hm/soft/soft.nix +++ b/hm/soft/soft.nix @@ -1,7 +1,7 @@ { ... }: { imports = [ - ./librewolf/browser.nix + ./browser.nix ./email.nix ./kdenlive.nix ./mangohud.nix diff --git a/hosts/thinkpad/configuration.nix b/hosts/thinkpad/configuration.nix index 5633579..dd507af 100644 --- a/hosts/thinkpad/configuration.nix +++ b/hosts/thinkpad/configuration.nix @@ -32,7 +32,6 @@ enable = true; cpu = "intel"; graphics.enable = true; - kernel = "stable"; }; fonts.enable = true; greet.enable = true; @@ -52,7 +51,9 @@ users.enable = true; }; srv = { + bluetooth.enable = true; i2p.enable = true; + yggdrasil.enable = true; files = { enable = true; localsend.enable = true; @@ -62,6 +63,7 @@ games.enable = true; steam.enable = true; }; + virtualization.kvm.enable = true; kdeconnect.enable = true; nix-helper.enable = true; monero.enable = true; @@ -74,5 +76,5 @@ niri.enable = true; }; }; - boot.kernelParams = [ "iomem=relaxed" ]; + # boot.kernelParams = [ "iomem=relaxed" ]; } diff --git a/os/srv/omnisearch.nix b/os/srv/omnisearch.nix index e3b05a0..dbc398c 100644 --- a/os/srv/omnisearch.nix +++ b/os/srv/omnisearch.nix @@ -13,5 +13,6 @@ in config = lib.mkIf cfg.enable { # services.omnisearch.enable = true; + networking.hosts."127.0.0.1" = [ "omnisearch.local" ]; }; } -- cgit v1.3