diff options
| author | Jörg Thalheim <joerg@thalheim.io> | 2020-05-30 02:14:06 +0100 |
|---|---|---|
| committer | Jörg Thalheim <joerg@thalheim.io> | 2020-05-30 02:14:06 +0100 |
| commit | eb7b41a2a0707483b22842158a59e68774fc4755 (patch) | |
| tree | 5c03fe4e7a8bc54cd55e806f47123a00d2875ea9 /modules/nix/default.nix | |
| parent | cec42039b0076f4cf002a4a00f29472d22528fb3 (diff) | |
nix: better defaults settings for maxJobs/buildCores
most users just want to use all available cores.
This commit aligns our defaults with what we do in NixOS
Diffstat (limited to 'modules/nix/default.nix')
| -rw-r--r-- | modules/nix/default.nix | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/modules/nix/default.nix b/modules/nix/default.nix index 4fbc06c..507d6b5 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -82,24 +82,25 @@ in }; nix.maxJobs = mkOption { - type = types.int; - default = 1; + type = types.either types.int (types.enum ["auto"]); + default = "auto"; example = 64; description = '' - This option defines the maximum number of jobs that Nix will try - to build in parallel. The default is 1. You should generally - set it to the total number of logical cores in your system (e.g., 16 - for two CPUs with 4 cores each and hyper-threading). + This option defines the maximum number of jobs that Nix will try to + build in parallel. The default is auto, which means it will use all + available logical cores. It is recommend to set it to the total + number of logical cores in your system (e.g., 16 for two CPUs with 4 + cores each and hyper-threading). ''; }; nix.buildCores = mkOption { type = types.int; - default = 1; + default = 0; example = 64; description = '' This option defines the maximum number of concurrent tasks during - one build. It affects, e.g., -j option for make. The default is 1. + 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 |
