From 6fe546b632eb50e01db63535ea04c9ac184ce939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matej=20Jane=C5=BEi=C4=8D?= Date: Fri, 20 Feb 2026 19:43:02 +0100 Subject: [PATCH] feat: move nix settings to nix.nix --- hosts/matej-nixos/configuration.nix | 5 ----- lib/mkHost.nix | 11 +---------- nix.nix | 23 +++++++++++++++++++++++ 3 files changed, 24 insertions(+), 15 deletions(-) create mode 100644 nix.nix diff --git a/hosts/matej-nixos/configuration.nix b/hosts/matej-nixos/configuration.nix index 36336ed..1cea18f 100644 --- a/hosts/matej-nixos/configuration.nix +++ b/hosts/matej-nixos/configuration.nix @@ -24,11 +24,6 @@ in yubikey.enable = true; - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; - stylix = { enable = true; polarity = "dark"; diff --git a/lib/mkHost.nix b/lib/mkHost.nix index 0d50ef3..b17168d 100644 --- a/lib/mkHost.nix +++ b/lib/mkHost.nix @@ -18,22 +18,13 @@ let user: import ../users/${user}/home-manager.nix { inherit inputs; } ); - gib_in_bytes = 1073741824; in nixpkgs.lib.nixosSystem { inherit system; modules = [ - { - nix.settings = { - download-buffer-size = 1 * gib_in_bytes; - experimental-features = [ - "nix-command" - "flakes" - ]; - }; - } + ../nix.nix { nixpkgs.overlays = overlays; } { nixpkgs.config.allowUnfree = true; } diff --git a/nix.nix b/nix.nix new file mode 100644 index 0000000..f7602fe --- /dev/null +++ b/nix.nix @@ -0,0 +1,23 @@ +{ + nix = { + settings = { + experimental-features = [ + "nix-command" + "flakes" + ]; + download-buffer-size = 2 * 1024 * 1024 * 1024; + warn-dirty = false; + }; + + gc = { + automatic = true; + dates = "monthly"; + options = "--delete-older-than 30d"; + }; + + optimise = { + automatic = true; + dates = [ "monthly" ]; + }; + }; +}