diff --git a/13-inch-thin-cannon/configuration.nix b/13-inch-thin-cannon/configuration.nix index c50b2f0..973dc0b 100644 --- a/13-inch-thin-cannon/configuration.nix +++ b/13-inch-thin-cannon/configuration.nix @@ -2,13 +2,22 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, lib, ... }: +{ + config, + pkgs, + lib, + ... +}: { imports = [ ./hardware-configuration.nix - ] ++ lib.optional (builtins.pathExists ./wireguard.nix) ./wireguard.nix; - nix.settings.experimental-features = [ "nix-command" "flakes" ]; + ] + ++ lib.optional (builtins.pathExists ./wireguard.nix) ./wireguard.nix; + nix.settings.experimental-features = [ + "nix-command" + "flakes" + ]; # Bootloader. boot.loader.systemd-boot.enable = true; @@ -75,7 +84,10 @@ users.users.file_magic = { isNormalUser = true; description = "file_magic"; - extraGroups = [ "networkmanager" "wheel" ]; + extraGroups = [ + "networkmanager" + "wheel" + ]; }; # Some programs need SUID wrappers, can be configured further or are @@ -97,9 +109,17 @@ # Or disable the firewall altogether. # networking.firewall.enable = false; + # Auto update + system.autoUpgrade = { + enable = true; + flake = "/home/file_magic/Projects/tangled/nix"; + operation = "boot"; + upgrade = true; + }; + programs.hyprland.enable = true; - powerManagement.cpuFreqGovernor = "powersave"; + powerManagement.cpuFreqGovernor = "performance"; # Proactive overheating prevention (especially for Intel CPUs) services.thermald.enable = true; #services.tlp.enable = true; @@ -107,7 +127,6 @@ powerManagement.powertop.enable = true; boot.kernelPackages = pkgs.linuxPackages_latest; - # This value determines the NixOS release from which the default # settings for stateful data, like file locations and database versions # on your system were taken. It‘s perfectly fine and recommended to leave diff --git a/13-inch-thin-cannon/home.nix b/13-inch-thin-cannon/home.nix index 7f73313..4e42e4d 100644 --- a/13-inch-thin-cannon/home.nix +++ b/13-inch-thin-cannon/home.nix @@ -5,7 +5,7 @@ ... }: let - hyprModule = import ../hyprland.nix { inherit pkgs lib; }; + hyprModule = import ../modules/hyprland.nix { inherit pkgs lib; }; in { imports = [ ../home.nix ]; diff --git a/flake.lock b/flake.lock index 6eb76af..4a650f2 100644 --- a/flake.lock +++ b/flake.lock @@ -2,9 +2,7 @@ "nodes": { "home-manager": { "inputs": { - "nixpkgs": [ - "nixpkgs" - ] + "nixpkgs": ["nixpkgs"] }, "locked": { "lastModified": 1783744526, diff --git a/home.nix b/home.nix index 8ccdfa4..3a57cb4 100644 --- a/home.nix +++ b/home.nix @@ -5,6 +5,8 @@ ... }: { + imports = [ ./modules/firefox.nix ]; + xdg = { configFile."mimeapps.list".force = true; mimeApps = { @@ -85,7 +87,6 @@ home.packages = with pkgs; [ steam bitwarden-desktop - firefox chromium tor-browser spotify diff --git a/modules/firefox.nix b/modules/firefox.nix new file mode 100644 index 0000000..099b048 --- /dev/null +++ b/modules/firefox.nix @@ -0,0 +1,180 @@ +{ + pkgs, + lib, + ... +}: +{ + programs.firefox = { + enable = true; + + # ---- Policies (locked, can't be overridden in about:config) ---- + policies = { + DisablePocket = true; + DisableFirefoxStudies = true; + DisableTelemetry = true; + DisableFirefoxAccounts = false; + FirefoxHome = { + Pocket = false; + Highlights = false; + TopSites = false; + SponsoredTopSites = false; + SponsoredPocket = false; + }; + UserMessaging = { + SkipOnboarding = true; + MoreFromMozilla = false; + ExtensionRecommendations = false; + FeatureRecommendations = false; + UrlbarInterventions = false; + WhatsNew = false; + }; + OfferToSaveLogins = false; + PasswordManagerEnabled = false; + SanitizeOnShutdown = true; + ShowHomeButton = true; + StartDownloadsInTempDirectory = true; + }; + + # ---- Preferences (can be overridden) ---- + preferences = { + # Privacy + "privacy.trackingprotection.fingerprinting.enabled" = true; + "privacy.trackingprotection.cryptomining.enabled" = true; + "privacy.trackingprotection.enabled" = true; + "privacy.resistFingerprinting" = true; + "privacy.clearOnShutdown.cache" = true; + "privacy.clearOnShutdown.cookies" = true; + "privacy.clearOnShutdown.history" = false; + "privacy.sanitize.sanitizeOnShutdown" = true; + + # Appearance + "browser.theme.toolbar-theme" = 0; + "ui.systemUsesDarkTheme" = 1; + "browser.compactmode.show" = true; + + # UI tweaks + "browser.uidensity" = 1; + "browser.toolbars.bookmarks.visibility" = "always"; + "browser.urlbar.suggest.history" = false; + "browser.urlbar.suggest.bookmark" = true; + "browser.urlbar.suggest.topsites" = false; + "browser.urlbar.quickaction.enabled" = true; + "extensions.pocket.enabled" = false; + + # Downloads + "browser.download.useDownloadDir" = true; + "browser.download.alwaysOpenPanel" = false; + + # Media + "media.autoplay.default" = 5; + "media.autoplay.enabled" = false; + "media.videocontrols.picture-in-picture.video-toggle.enabled" = true; + + # Developer tools + "devtools.toolbox.host" = "right"; + "devtools.inspector.showUserAgentStyles" = false; + }; + + # ---- Extensions ---- + extensions = with pkgs.nur.repos.rycee.firefox-addons; [ + ublock-origin + bitwarden + vimium + istilldontcareaboutcookies + darkreader + sponsorblock + return-youtube-dislikes + ]; + + # ---- Default profile ---- + profiles.default = { + id = 0; + name = "default"; + isDefault = true; + + search = { + force = true; + default = "DuckDuckGo"; + engines = { + "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" ]; + }; + "Nix Options" = { + urls = [ + { + template = "https://search.nixos.org/options"; + params = [ + { + name = "type"; + value = "options"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@no" ]; + }; + "Nix Flakes" = { + urls = [ + { + template = "https://search.nixos.org/flakes"; + params = [ + { + name = "type"; + value = "flakes"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@nf" ]; + }; + "Home Manager Options" = { + urls = [ + { + template = "https://home-manager-options.extranix.com"; + params = [ + { + name = "query"; + value = "{searchTerms}"; + } + ]; + } + ]; + icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@hm" ]; + }; + }; + }; + + settings = { + # Let the policy handle this instead + "browser.download.alwaysOpenPanel" = false; + }; + }; + }; +} diff --git a/hyprland.nix b/modules/hyprland.nix similarity index 100% rename from hyprland.nix rename to modules/hyprland.nix diff --git a/thick-black-cannon/configuration.nix b/thick-black-cannon/configuration.nix index ba2b89b..4b0f39a 100644 --- a/thick-black-cannon/configuration.nix +++ b/thick-black-cannon/configuration.nix @@ -17,7 +17,7 @@ # Auto update system.autoUpgrade = { enable = true; - flake = "/home/file_magic/Projects/github/dotfiles/flake.nix"; + flake = "/home/file_magic/Projects/tangled/nix"; operation = "boot"; upgrade = true; }; diff --git a/thick-black-cannon/home.nix b/thick-black-cannon/home.nix index 90f30c0..946dfce 100644 --- a/thick-black-cannon/home.nix +++ b/thick-black-cannon/home.nix @@ -5,7 +5,7 @@ ... }: let - hyprModule = import ../hyprland.nix { inherit pkgs lib; }; + hyprModule = import ../modules/hyprland.nix { inherit pkgs lib; }; in { imports = [ ../home.nix ];