From 3333ed62b6d0ab6fb87b1dad0f135fb9f474a403 Mon Sep 17 00:00:00 2001 From: Fern Garden Date: Sun, 10 Aug 2025 22:03:48 +0800 Subject: [PATCH] Limit nix build --- suites/default.nix | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/suites/default.nix b/suites/default.nix index 79c38f7..b590056 100644 --- a/suites/default.nix +++ b/suites/default.nix @@ -9,14 +9,23 @@ with lib; { # NixOS version. system.stateVersion = "25.05"; - # Enable flakes. - nix.settings.experimental-features = [ - "nix-command" - "flakes" - ]; + # nix config. + nix = { + # Set $NIX_PATH. + nixPath = ["nixpkgs=${inputs.nixpkgs}"]; - # Set $NIX_PATH. - nix.nixPath = ["nixpkgs=${inputs.nixpkgs}"]; + settings = { + # Enable flakes. + experimental-features = [ + "nix-command" + "flakes" + ]; + + # Limit nix build. + cores = 2; + max-jobs = 2; + }; + }; # Enable redistributable firmware. hardware.enableRedistributableFirmware = true; @@ -60,9 +69,7 @@ with lib; { isNormalUser = true; uid = 1000; description = "Fern Garden"; - extraGroups = [ - "wheel" - ]; + extraGroups = ["wheel"]; }; # Use fish shell