From b98c824f870472db365122f0252c5994a28368f0 Mon Sep 17 00:00:00 2001 From: Bloxx12 Date: Mon, 2 Jun 2025 17:18:22 +0200 Subject: [PATCH] nix: module: set max-jobs to "auto" and cores to 0 --- modules/system/nix/module.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/system/nix/module.nix b/modules/system/nix/module.nix index 8bae420..80e2b4c 100644 --- a/modules/system/nix/module.nix +++ b/modules/system/nix/module.nix @@ -51,6 +51,9 @@ in { dates = ["21:00"]; }; + # NOTE: + # Writes the settings to /etc/nix/nix.conf. + # See `man nix.conf` for more detailed descriptions of these settings. settings = { # Tell nix to use the xdg spec for base directories # while transitioning, any state must be carried over @@ -69,7 +72,14 @@ in { # Let the system decide the number of max jobs # based on available system specs. Usually this is # the same as the number of cores your CPU has. - max-jobs = 2; + max-jobs = "auto"; + + # This option defines the maximum number of concurrent tasks during one build. + # It affects, e.g., -j option for make. The special value 0 means that the builder + # should use all available CPU cores in the system. Some builds may become + # non-deterministic with this option; use with care! + # Packages will only be affected if enableParallelBuilding is set for them. + cores = 0; # If set, Nix will perform builds in a sandboxed environment # that it will set up automatically for each build.