From b34040203c289ea8808ccabbedd19d3fc475ca07 Mon Sep 17 00:00:00 2001 From: 4DBug <4DBug@github.com> Date: Tue, 3 Mar 2026 15:01:19 -0600 Subject: [PATCH] organize and configure librewolf --- flake.lock | 84 ++++++++++- flake.nix | 5 + modules/core/boot.nix | 22 +++ modules/core/essentials.nix | 26 ++++ modules/core/locale.nix | 23 +++ modules/core/security.nix | 10 ++ modules/hosts/box/box.nix | 12 +- modules/hosts/defaults.nix | 87 ++--------- modules/hosts/laptop/laptop.nix | 35 +++-- modules/hosts/nix/nix.nix | 34 +++-- modules/software/browsers/librewolf.nix | 191 +++++++++++++++++++++++- modules/software/fish.nix | 7 +- modules/software/music/nicotine.nix | 2 +- modules/software/music/player.nix | 1 + 14 files changed, 421 insertions(+), 118 deletions(-) create mode 100644 modules/core/boot.nix create mode 100644 modules/core/essentials.nix create mode 100644 modules/core/locale.nix create mode 100644 modules/core/security.nix diff --git a/flake.lock b/flake.lock index ee645b0..87dad03 100644 --- a/flake.lock +++ b/flake.lock @@ -86,9 +86,48 @@ "type": "github" } }, + "catppuccin-userstyles": { + "flake": false, + "locked": { + "lastModified": 1749817927, + "narHash": "sha256-lftRs+pfcOrqHDtDWX/Vd/CQvDJguCRxlhI/aIkIB/k=", + "owner": "catppuccin", + "repo": "userstyles", + "rev": "714b153c7022c362a37ab8530286a87e4484a828", + "type": "github" + }, + "original": { + "owner": "catppuccin", + "repo": "userstyles", + "type": "github" + } + }, + "catppuccin-userstyles-nix": { + "inputs": { + "catppuccin-userstyles": "catppuccin-userstyles", + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems" + }, + "locked": { + "lastModified": 1751092982, + "narHash": "sha256-9za67Wu6iPpzhzO9YWtHVaq/bh9wOqGy3j4WlkLsA3Q=", + "owner": "different-name", + "repo": "catppuccin-userstyles-nix", + "rev": "02fdea4a171f3f1d87d7a436cb54f9b545e15d4b", + "type": "github" + }, + "original": { + "owner": "different-name", + "repo": "catppuccin-userstyles-nix", + "type": "github" + } + }, "copyparty": { "inputs": { - "flake-utils": "flake-utils", + "flake-utils": "flake-utils_2", "nixpkgs": "nixpkgs_2" }, "locked": { @@ -240,6 +279,27 @@ } }, "flake-utils": { + "inputs": { + "systems": [ + "catppuccin-userstyles-nix", + "systems" + ] + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { "locked": { "lastModified": 1678901627, "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", @@ -466,6 +526,7 @@ "root": { "inputs": { "catppuccin": "catppuccin", + "catppuccin-userstyles-nix": "catppuccin-userstyles-nix", "copyparty": "copyparty", "den": "den", "flake-aspects": "flake-aspects", @@ -480,7 +541,7 @@ "nixpkgs" ], "stylix": "stylix", - "systems": "systems_2" + "systems": "systems_3" } }, "stylix": { @@ -496,7 +557,7 @@ "nixpkgs" ], "nur": "nur", - "systems": "systems", + "systems": "systems_2", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -518,6 +579,21 @@ } }, "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_2": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", @@ -532,7 +608,7 @@ "type": "github" } }, - "systems_2": { + "systems_3": { "locked": { "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", diff --git a/flake.nix b/flake.nix index 2f8517a..55ffaa8 100644 --- a/flake.nix +++ b/flake.nix @@ -30,5 +30,10 @@ catppuccin.url = "github:catppuccin/nix"; nixcord.url = "github:FlameFlag/nixcord"; + + catppuccin-userstyles-nix = { + url = "github:different-name/catppuccin-userstyles-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; } diff --git a/modules/core/boot.nix b/modules/core/boot.nix new file mode 100644 index 0000000..fddb830 --- /dev/null +++ b/modules/core/boot.nix @@ -0,0 +1,22 @@ +{ + den.aspects.boot = { + nixos = { + boot = { + # kernelPackages = lib.mkForce pkgs.linuxPackages_zen; + + initrd.checkJournalingFS = false; + + loader = { + grub.splashImage = null; + + systemd-boot = { + enable = true; + configurationLimit = 25; + }; + + efi.canTouchEfiVariables = true; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/core/essentials.nix b/modules/core/essentials.nix new file mode 100644 index 0000000..193de5c --- /dev/null +++ b/modules/core/essentials.nix @@ -0,0 +1,26 @@ +{ + den.aspects.essentials = { + nixos = { pkgs, ... }: { + environment.systemPackages = with pkgs; [ + comma + fastfetch + git + home-manager + inetutils + micro + nh + nil + nixd + nixfmt + nix-index + nix-output-monitor + nix-prefetch + nvd + psmisc + tree + unzip + wget + ]; + }; + }; +} \ No newline at end of file diff --git a/modules/core/locale.nix b/modules/core/locale.nix new file mode 100644 index 0000000..4303a65 --- /dev/null +++ b/modules/core/locale.nix @@ -0,0 +1,23 @@ +{ + den.aspects.locale = { + nixos = { + time.timeZone = "America/Chicago"; + + i18n = { + defaultLocale = "en_US.UTF-8"; + + extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/core/security.nix b/modules/core/security.nix new file mode 100644 index 0000000..0b92164 --- /dev/null +++ b/modules/core/security.nix @@ -0,0 +1,10 @@ +{ + den.aspects.security = { + nixos = { + security.sudo = { + enable = true; + wheelNeedsPassword = false; + }; + }; + }; +} \ No newline at end of file diff --git a/modules/hosts/box/box.nix b/modules/hosts/box/box.nix index 764a10a..fa13443 100644 --- a/modules/hosts/box/box.nix +++ b/modules/hosts/box/box.nix @@ -4,10 +4,17 @@ includes = with den.aspects; [ den.default den.provides.home-manager + + dns + openssh + + # cloudflared syncthing + + catppuccin + fish - #cloudflared searxng copyparty glances @@ -17,10 +24,7 @@ redlib # sish vscode-server - dns - openssh gitea - catppuccin (tunnel 3001 "tvtun") (tunnel 8888 "search") diff --git a/modules/hosts/defaults.nix b/modules/hosts/defaults.nix index 0e1d02e..224a73a 100644 --- a/modules/hosts/defaults.nix +++ b/modules/hosts/defaults.nix @@ -1,6 +1,13 @@ -{ +{ den, ... }: { den.default = { - nixos = { pkgs, ... }: { + includes = with den.aspects; [ + boot + security + locale + essentials + ]; + + nixos = { ... }: { imports = [ /etc/nixos/hardware-configuration.nix ]; @@ -17,86 +24,16 @@ }; }; - nixpkgs = { - config = { - allowUnfree = true; - }; - }; + nixpkgs.config.allowUnfree = true; nix = { optimise.automatic = true; settings.experimental-features = [ "nix-command" "flakes" ]; }; - - security = { - sudo = { - enable = true; - wheelNeedsPassword = false; - }; - }; - - boot = { - #kernelPackages = lib.mkForce pkgs.linuxPackages_zen; - - initrd.checkJournalingFS = false; - - loader = { - grub.splashImage = null; - - systemd-boot = { - enable = true; - configurationLimit = 25; - }; - - efi.canTouchEfiVariables = true; - }; - }; - - environment.systemPackages = with pkgs; [ - comma - fastfetch - git - home-manager - inetutils - micro - nh - nil - nixd - nixfmt - nix-index - nix-output-monitor - nix-prefetch - nvd - psmisc - tree - unzip - wget - tree - ]; - - time.timeZone = "America/Chicago"; - - i18n = { - defaultLocale = "en_US.UTF-8"; - - extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - }; }; homeManager = { - home = { - stateVersion = "26.05"; - }; + home.stateVersion = "26.05"; }; }; -} +} \ No newline at end of file diff --git a/modules/hosts/laptop/laptop.nix b/modules/hosts/laptop/laptop.nix index 0bdd2c3..d89a884 100644 --- a/modules/hosts/laptop/laptop.nix +++ b/modules/hosts/laptop/laptop.nix @@ -2,30 +2,39 @@ den.aspects.laptop = { includes = with den.aspects; [ den.default - den.aspects.amdgpu + den.provides.home-manager + + amdgpu + cosmic - firefox audio - den.provides.home-manager - stylix - syncthing swap - cloudflare-warp - development - cad virtualisation - flatpak - fish + dns openssh + cloudflare-warp + + syncthing + + stylix catppuccin - music - social - gaming + + fish + flatpak + development + cad compatibility utilities janitor + + firefox + librewolf + + music + social + gaming ]; nixos = { diff --git a/modules/hosts/nix/nix.nix b/modules/hosts/nix/nix.nix index 2e523bb..9b329de 100644 --- a/modules/hosts/nix/nix.nix +++ b/modules/hosts/nix/nix.nix @@ -3,30 +3,38 @@ den.aspects.nix = { includes = with den.aspects; [ den.default - #amdgpu + den.provides.home-manager + + nvidia + cosmic - firefox audio - den.provides.home-manager - stylix - nvidia - syncthing swap - #cloudflare-warp - development - #cad virtualisation - flatpak - fish + dns openssh + # cloudflare-warp + + syncthing + + stylix catppuccin + + fish + flatpak + development + # cad + compatibility + utilities + + firefox + librewolf + music social gaming - compatibility - utilities ]; nixos = { diff --git a/modules/software/browsers/librewolf.nix b/modules/software/browsers/librewolf.nix index 3376222..4f51419 100644 --- a/modules/software/browsers/librewolf.nix +++ b/modules/software/browsers/librewolf.nix @@ -1,24 +1,201 @@ -{ +{ inputs, ... }: { den.aspects.librewolf = { - homeManager = { + homeManager = { pkgs, ... }: { programs.librewolf = { enable = true; settings = { "browser.startup.homepage" = "https://search.bug.tools"; + "browser.startup.page" = 1; + + "datareporting.healthreport.uploadEnabled" = false; + "datareporting.policy.dataSubmissionEnabled" = false; + "toolkit.telemetry.enabled" = false; + "toolkit.telemetry.unified" = false; + "toolkit.telemetry.archive.enabled" = false; + "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.coverage.opt-out" = true; + "toolkit.coverage.opt-out" = true; + "app.shield.optoutstudies.enabled" = false; + "app.normandy.enabled" = false; + "app.normandy.api_url" = ""; + "breakpad.reportURL" = ""; + "browser.tabs.crashReporting.sendReport" = false; + "browser.crashReports.unsubmittedCheck.enabled" = false; + "browser.crashReports.unsubmittedCheck.autoSubmit2" = false; + + "privacy.resistFingerprinting.letterboxing" = true; + "privacy.donottrackheader.enabled" = true; + "privacy.globalprivacycontrol.enabled" = true; + + "browser.search.separatePrivateDefault" = false; + + "browser.download.autohideButton" = true; + "browser.quitShortcut.disabled" = true; + "browser.sessionstore.resume_session_once" = true; + + "browser.cache.memory.capacity" = 65536; + "browser.sessionstore.interval" = 60000; + "browser.sessionstore.max_tabs_undo" = 10; + "browser.sessionstore.max_windows_undo" = 1; + "browser.tabs.unloadOnLowMemory" = true; + + "gfx.webrender.all" = true; + "gfx.canvas.accelerated" = true; + "media.hardware-video-decoding.force-enabled" = true; + + "network.http.max-connections" = 1500; + "network.http.max-persistent-connections-per-server" = 10; + "network.prefetch-next" = false; + + "browser.tabs.animate" = false; + "browser.fullscreen.animate" = false; }; - # set default search engine to search.bug.tools (searxng) + profiles.default = { + search = { + force = true; + default = "search.bug.tools"; - # and add stylus, tampermonkey, sponsorblock, dearrow, cookie quick manager + engines = { + "search.bug.tools" = { + urls = [ + { + template = "https://search.bug.tools/search"; + params = [ + { name = "q"; value = "{searchTerms}"; } + ]; + } + ]; + icon = "https://search.bug.tools/favicon.ico"; + definedAliases = [ "@s" "@sq" ]; + }; + + "NixOS Packages" = { + urls = [ + { + template = "https://search.nixos.org/packages"; + params = [ + { name = "channel"; value = "unstable"; } + { name = "query"; value = "{searchTerms}"; } + ]; + } + ]; + icon = "https://search.nixos.org/favicon.png"; + definedAliases = [ "@np" ]; + }; + + "NixOS Options" = { + urls = [ + { + template = "https://search.nixos.org/options"; + params = [ + { name = "channel"; value = "unstable"; } + { name = "query"; value = "{searchTerms}"; } + ]; + } + ]; + icon = "https://search.nixos.org/favicon.png"; + definedAliases = [ "@no" ]; + }; + + "Home Manager Options" = { + urls = [ + { + template = "https://home-manager-options.extranix.com/"; + params = [ + { name = "query"; value = "{searchTerms}"; } + { name = "release"; value = "master"; } + ]; + } + ]; + icon = "https://home-manager-options.extranix.com/images/favicon.png"; + definedAliases = [ "@hm" ]; + }; + + google.metaData.hidden = true; + bing.metaData.hidden = true; + amazondotcom-us.metaData.hidden = true; + ebay.metaData.hidden = true; + + wikipedia.metaData = { + hidden = false; + alias = "@w"; + }; + }; + }; + + extensions = { + force = true; + settings = { + "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}" = { + force = true; + settings = inputs.catppuccin-userstyles-nix.stylusSettings.${pkgs.stdenv.hostPlatform.system} { + global = { + lightFlavor = "mocha"; + darkFlavor = "mocha"; + accentColor = "mauve"; + }; + }; + }; + }; + }; + }; policies = { - BlockAboutConfig = true; - }; + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; - # https://github.com/nix-community/nur-combined/blob/main/repos/rycee/pkgs/firefox-addons/generated-firefox-addons.nix + BlockAboutConfig = true; + + DisableTelemetry = true; + DisableFirefoxStudies = true; + DisableFeedbackCommands = true; + DisableCrashReporter = true; + + DisablePocket = true; + + # DisableFirefoxAccounts = true; + + ExtensionSettings = let + extension = slug: { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/${slug}/latest.xpi"; + installation_mode = "force_installed"; + private_browsing = true; + }; + in + { + "*".installation_mode = "blocked"; + + "{1b66b5ad-408f-4300-aac6-55a68b2b24ff}" = extension "catppuccin-mocha-no-borders"; + + "{bbb880ce-43c9-47ae-b746-c3e0096c5b76}" = extension "catppuccin-web-file-icons"; + + "{60f82f00-9ad5-4de5-b31c-b16a47c51558}" = extension "cookie-quick-manager"; + + "{88ebde3a-4581-4c6b-8019-2a05a9e3e938}" = extension "hide-youtube-shorts"; + + "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}" = extension "styl-us"; + + # "firefox@tampermonkey.net" = extension "tampermonkey"; + + "deArrow@ajay.app" = extension "dearrow"; + + "sponsorBlocker@ajay.app" = extension "sponsorblock"; + + "uBlock0@raymondhill.net" = extension "ublock-origin"; + + # lesspass + # user agent switcher + # return youtube dislike + }; + }; }; }; }; diff --git a/modules/software/fish.nix b/modules/software/fish.nix index 00dea9f..0c61aac 100644 --- a/modules/software/fish.nix +++ b/modules/software/fish.nix @@ -1,9 +1,14 @@ { den.aspects.fish = { - nixos = { + nixos = { pkgs, ...}: { programs.fish.shellAliases = { box = "ssh box.bug.tools"; }; + + environment.systemPackages = with pkgs.fishPlugins; [ + done + sponge + ]; }; }; } diff --git a/modules/software/music/nicotine.nix b/modules/software/music/nicotine.nix index 6f7cbc1..38437c7 100644 --- a/modules/software/music/nicotine.nix +++ b/modules/software/music/nicotine.nix @@ -6,4 +6,4 @@ ]; }; }; -} \ No newline at end of file +} diff --git a/modules/software/music/player.nix b/modules/software/music/player.nix index 2ddc360..f302a60 100644 --- a/modules/software/music/player.nix +++ b/modules/software/music/player.nix @@ -3,6 +3,7 @@ nixos = { pkgs, ... }: { users.users.bug.packages = with pkgs; [ euphonica + rhythmbox ]; services.flatpak.packages = [