mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-11 20:25:32 +03:00
nixos: default nix.maxJobs to auto
Instead of making the configuration less portable by hard coding the number of jobs equal to the cores we can also let nix set the same number at runtime.
This commit is contained in:
parent
5d3f4e9c0b
commit
e6a15db534
2 changed files with 6 additions and 9 deletions
|
@ -91,9 +91,6 @@ sub hasCPUFeature {
|
|||
}
|
||||
|
||||
|
||||
# Detect the number of CPU cores.
|
||||
my $cpus = scalar (grep {/^processor\s*:/} (split '\n', $cpuinfo));
|
||||
|
||||
|
||||
# Determine CPU governor to use
|
||||
if (-e "/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors") {
|
||||
|
@ -562,7 +559,6 @@ my $hwConfig = <<EOF;
|
|||
boot.kernelModules = [$kernelModules ];
|
||||
boot.extraModulePackages = [$modulePackages ];
|
||||
$fsAndSwap
|
||||
nix.maxJobs = lib.mkDefault $cpus;
|
||||
${\join "", (map { " $_\n" } (uniq @attrs))}}
|
||||
EOF
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue