From 377cd79704fcb42e057931b4f9bb0b071f82a765 Mon Sep 17 00:00:00 2001 From: lsoriano-mcm Date: Fri, 4 Jul 2025 11:32:08 -0500 Subject: [PATCH] unknown --- config.nix | 1 + flake.lock | 67 +++++++++++++++++- flake.nix | 9 +-- hosts/hakase/configuration.nix | 38 ++++++++++ modules/default/desktop.nix | 2 + modules/home/desktop.nix | 4 ++ packages/firefox/home.nix | 126 +++++++++++++++++++++++++++++++++ 7 files changed, 242 insertions(+), 5 deletions(-) create mode 100644 hosts/hakase/configuration.nix create mode 100644 modules/default/desktop.nix create mode 100644 modules/home/desktop.nix create mode 100644 packages/firefox/home.nix diff --git a/config.nix b/config.nix index ac2ed9b..d87219b 100644 --- a/config.nix +++ b/config.nix @@ -13,6 +13,7 @@ ls = "ls --color=auto"; }; }; + allowUnfree = true; }; nixos = { diff --git a/flake.lock b/flake.lock index 4f8bc2f..933ff27 100644 --- a/flake.lock +++ b/flake.lock @@ -96,6 +96,27 @@ "type": "github" } }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "flake-utils": { "inputs": { "systems": "systems" @@ -386,6 +407,28 @@ "type": "github" } }, + "nur": { + "inputs": { + "flake-parts": "flake-parts_3", + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix_2" + }, + "locked": { + "lastModified": 1751596056, + "narHash": "sha256-YYSPbbr900ciunCWYPIvUbSnnchcMWH907w4LY7uyZs=", + "owner": "nix-community", + "repo": "NUR", + "rev": "8062772f4de4a7ce091bfdb88322e236cffcff30", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, "nuschtosSearch": { "inputs": { "flake-utils": "flake-utils_2", @@ -416,7 +459,8 @@ "flake-utils": "flake-utils", "home-manager": "home-manager", "nixovim": "nixovim", - "nixpkgs": "nixpkgs_3" + "nixpkgs": "nixpkgs_3", + "nur": "nur" } }, "rust-overlay": { @@ -488,6 +532,27 @@ "repo": "treefmt-nix", "type": "github" } + }, + "treefmt-nix_2": { + "inputs": { + "nixpkgs": [ + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733222881, + "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "49717b5af6f80172275d47a418c9719a31a78b53", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index ddaeb66..e1694d5 100644 --- a/flake.nix +++ b/flake.nix @@ -2,14 +2,15 @@ description = "A rewrite of the original Sakamoto NixOS config."; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; - home-manager = { - url = "github:nix-community/home-manager"; + nur = { + url = "github:nix-community/NUR"; inputs.nixpkgs.follows = "nixpkgs"; }; - flake-utils = { - url = "github:numtide/flake-utils"; + home-manager = { + url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; diff --git a/hosts/hakase/configuration.nix b/hosts/hakase/configuration.nix new file mode 100644 index 0000000..616c2cf --- /dev/null +++ b/hosts/hakase/configuration.nix @@ -0,0 +1,38 @@ +{ + pkgs, + myConfig, + inputs, + lib, + ... +}: { + imports = [ + ./hardware-configuration.nix + ]; + + nixpkgs.config.allowUnfree = myConfig.general.allowUnfree; + + boot.loader = { + systemd-boot = lib.mkIf (myConfig.nixos.Boot.mode == "systemd") { + enable = false; + }; + grub = lib.mkIf (myConfig.nixos.Boot.mode == "grub") { + enable = true; + device = "nodev"; + }; + efi = { + canTouchEfiVariables = true; + }; + }; + + nix = { + distributedBuilds = true; + settings = { + builders-use-substitutes = true; + trusted-users = myConfig.optionals.Builds.trustedUsers; + experimental-features = ["nix-command" "flakes"]; + }; + }; + + programs.ssh.extraConfig = myConfig.general.ssh.extraConfig; + system.stateVersion = "25.05"; +} diff --git a/modules/default/desktop.nix b/modules/default/desktop.nix new file mode 100644 index 0000000..2c63c08 --- /dev/null +++ b/modules/default/desktop.nix @@ -0,0 +1,2 @@ +{ +} diff --git a/modules/home/desktop.nix b/modules/home/desktop.nix new file mode 100644 index 0000000..f7e9be4 --- /dev/null +++ b/modules/home/desktop.nix @@ -0,0 +1,4 @@ +{ + imports = [ + ]; +} diff --git a/packages/firefox/home.nix b/packages/firefox/home.nix new file mode 100644 index 0000000..a1946dc --- /dev/null +++ b/packages/firefox/home.nix @@ -0,0 +1,126 @@ +{ + programs.firefox = { + enable = true; + languagePacks = [ + "en-US" + ]; + profiles = { + hakase = { + isDefault = true; + search.default = "DuckDuckGo"; + settings = { + "browser.startup.homepage" = "https://nixos.org"; + "browser.newtabpage.pinned" = [ + { + title = "NixOS"; + url = "https://nixos.org"; + } + ]; + }; + bookmarks = { + force = true; + settings = [ + { + name = "wikipedia"; + tags = ["wiki"]; + keyword = "wiki"; + url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go"; + } + { + name = "kernel.org"; + url = "https://www.kernel.org"; + } + { + name = "Nix sites"; + toolbar = true; + bookmarks = [ + { + name = "homepage"; + url = "https://nixos.org/"; + } + { + name = "wiki"; + tags = ["wiki" "nix"]; + url = "https://wiki.nixos.org/"; + } + ]; + } + ]; + }; + }; + }; + + policies = { + 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" + + /* + ---- EXTENSIONS ---- + */ + # Check about:support for extension/add-on ID strings. + # Valid strings for installation_mode are "allowed", "blocked", + # "force_installed" and "normal_installed". + ExtensionSettings = { + "*".installation_mode = "blocked"; # blocks all addons except the ones specified below + # uBlock Origin: + "uBlock0@raymondhill.net" = { + install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi"; + installation_mode = "force_installed"; + }; + "{446900e4-71c2-419f-a6a7-df9c091e268b}" = { + install_url = "https://addons.mozilla.org/firefox/downloads/file/4493940/bitwarden_password_manager-2025.5.0.xpi"; + installation_mode = "force_installed"; + }; + "tridactyl.vim@cmcaine.co.uk" = { + install_url = "https://addons.mozilla.org/firefox/downloads/file/4405615/tridactyl_vim-1.24.2.xpi"; + installation_mode = "force_installed"; + }; + # Privacy Badger: + # "jid1-MnnxcxisBPnSXQ@jetpack" = { + # install_url = "https://addons.mozilla.org/firefox/downloads/latest/privacy-badger17/latest.xpi"; + # installation_mode = "force_installed"; + # }; + # 1Password: + # "{d634138d-c276-4fc8-924b-40a0ea21d284}" = { + # install_url = "https://addons.mozilla.org/firefox/downloads/latest/1password-x-password-manager/latest.xpi"; + # installation_mode = "force_installed"; + }; + }; + preferences = { + "browser.contentblocking.category" = "strict"; + "extensions.pocket.enabled" = false; + "extensions.screenshots.disabled" = true; + "browser.topsites.contile.enabled" = false; + "browser.formfill.enable" = false; + "browser.search.suggest.enabled" = false; + "browser.search.suggest.enabled.private" = false; + "browser.urlbar.suggest.searches" = false; + "browser.urlbar.showSearchSuggestionsFirst" = false; + "browser.newtabpage.activity-stream.feeds.section.topstories" = false; + "browser.newtabpage.activity-stream.feeds.snippets" = false; + "browser.newtabpage.activity-stream.section.highlights.includePocket" = false; + "browser.newtabpage.activity-stream.section.highlights.includeBookmarks" = false; + "browser.newtabpage.activity-stream.section.highlights.includeDownloads" = false; + "browser.newtabpage.activity-stream.section.highlights.includeVisited" = false; + "browser.newtabpage.activity-stream.showSponsored" = false; + "browser.newtabpage.activity-stream.system.showSponsored" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + }; + }; +}