From dcaaeb02e17e006826493ea8d76fe18030c08963 Mon Sep 17 00:00:00 2001 From: Chris Date: Sun, 22 Feb 2026 23:49:42 +0000 Subject: [PATCH] Update nix --- home/user/programs.nix | 141 +++++++++++++++++++++++++++++++++++++---- system/mounts.nix | 34 ++++++++++ 2 files changed, 163 insertions(+), 12 deletions(-) create mode 100644 system/mounts.nix diff --git a/home/user/programs.nix b/home/user/programs.nix index e1d8547..88db7a4 100644 --- a/home/user/programs.nix +++ b/home/user/programs.nix @@ -1,17 +1,134 @@ { inputs, ... }: -{ - programs.firefox = { - enable = true; - - profiles.chris = { - extensions = with inputs.firefox-addons.packages."x86_64-linux"; [ - darkreader - i-dont-care-about-cookies - ublock-origin - ]; +let + lock-false = { + Value = false; + Status = "locked"; }; - }; + lock-true = { + Value = true; + Status = "locked"; + }; +in + { + programs = { + firefox = { + enable = true; + package = pkgs.wrapFirefox pkgs.firefox-unwrapped { + extraPolicies = { + DisableTelemetry = true; + DisableFirefoxStudies = true; + EnableTrackingProtection = { + Value= true; + Locked = true; + Cryptomining = true; + Fingerprinting = true; + }; + DisablePocket = true; + DisableFirefoxAccounts = true; + DisableAccounts = true; + DisableFirefoxScreenshots = true; + OverrideFirstRunPage = ""; + OverridePostUpdatePage = ""; + DontCheckDefaultBrowser = true; + DisplayBookmarksToolbar = "always"; # alternatives: "always" or "newtab" + DisplayMenuBar = "default-off"; # alternatives: "always", "never" or "default-on" + SearchBar = "unified"; # alternative: "separate" - programs.home-manager.enable = true; + /* ---- EXTENSIONS ---- */ + ExtensionSettings = { + "*".installation_mode = "allowed"; # blocks all addons except the ones specified below + # Enpass + "firefox-enpass@enpass.io" = { + install_url = "https://dl.enpass.io/stable/extensions/firefox/versions/v6.11.10.2/enpass_password_manager-6.11.10.2.xpi"; + installation_mode = "force_installed"; + }; + }; + + /* ---- PREFERENCES ---- */ + # Set preferences shared by all profiles. + Preferences = { + "browser.contentblocking.category" = { Value = "strict"; Status = "locked"; }; + "extensions.pocket.enabled" = lock-false; + "extensions.screenshots.disabled" = lock-true; + "browser.topsites.contile.enabled" = lock-false; + "browser.formfill.enable" = lock-false; + "browser.search.suggest.enabled" = lock-false; + "browser.search.suggest.enabled.private" = lock-false; + "browser.urlbar.suggest.searches" = lock-false; + "browser.urlbar.showSearchSuggestionsFirst" = lock-false; + "browser.newtabpage.activity-stream.feeds.section.topstories" = lock-false; + "browser.newtabpage.activity-stream.feeds.snippets" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includePocket" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = lock-false; + "browser.newtabpage.activity-stream.section.highlights.includeVisited" = lock-false; + "browser.newtabpage.activity-stream.showSponsored" = lock-false; + "browser.newtabpage.activity-stream.system.showSponsored" = lock-false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = lock-false; + }; + }; + }; + }; + + /* ---- PROFILES ---- */ + # Switch profiles via about:profiles page. + # For options that are available in Home-Manager see + # https://nix-community.github.io/home-manager/options.html#opt-programs.firefox.profiles + profiles ={ + chris = { # choose a profile name; directory is /home//.mozilla/firefox/chris + id = 0; # 0 is the default profile; see also option "isDefault" + name = "chris"; # name as listed in about:profiles + isDefault = true; # can be omitted; true if profile ID is 0 + settings = { # specify profile-specific preferences here; check about:config for options + "browser.startup.homepage" = "https://tower.scarif.space"; + # "browser.newtabpage.pinned" = [{ + # title = "NixOS"; + # url = "https://nixos.org"; + # }]; + }; + search = { + force = true; + default = "holocron"; + engines = { + holocron = { + name = "Holocron"; + urls = [{ + template = "https://holocron.scarif.space/search"; + params = [ + { name = "q"; value = "{searchTerms}"; } + ]; + }]; + iconUpdateURL = "https://holocron.scarif.space/static/themes/simple/img/favicon.png"; + definedAliases = [ "@h" ]; # Allows you to type '@s query' in the URL bar + }; + nix-packages = { + name = "Nix Packages"; + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { name = "type"; value = "packages"; } + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; + + nixos-wiki = { + name = "NixOS Wiki"; + urls = [{ template = "https://wiki.nixos.org/w/index.php?search={searchTerms}"; }]; + iconMapObj."16" = "https://wiki.nixos.org/favicon.ico"; + definedAliases = [ "@nw" ]; + }; + + bing.metaData.hidden = true; + google.metaData.alias = "@g"; # builtin engines only support specifying one additional alias + }; + }; + }; + }; + }; + programs.home-manager.enable = true; } diff --git a/system/mounts.nix b/system/mounts.nix new file mode 100644 index 0000000..ba0e1e0 --- /dev/null +++ b/system/mounts.nix @@ -0,0 +1,34 @@ +{ pkgs, ... }: + +{ + # Ensure NFS support is installed + environment.systemPackages = [ pkgs.nfs-utils ]; + + fileSystems = { + "/home/chris/Stardust" = { + device = "192.168.2.158:/mnt/tower/stardust/chris/files"; + fsType = "nfs4"; + options = [ + "defaults" + "x-systemd.mount-timeout=5" + "user" + "exec" + "x-systemd.automount" # Mounts on access + "noauto" # Doesn't block boot if server is down + ]; + }; + + "/home/chris/Foundry" = { + device = "192.168.2.158:/mnt/tower/foundry/Data"; + fsType = "nfs4"; + options = [ + "defaults" + "x-systemd.mount-timeout=5" + "user" + "exec" + "x-systemd.automount" + "noauto" + ]; + }; + }; +}