mirror of
https://github.com/nix-community/disko.git
synced 2026-12-01 13:33:28 +01:00
disko-images: add copyNixStoreThreads option for configurable parallelism
Allow users to override the automatic thread count detection for nix store copying. The default "auto" behavior remains unchanged (min of nproc and 8), but users can now specify a fixed thread count for environments where the automatic detection isn't optimal.
This commit is contained in:
1 parent
10cdd63203
commit
8e68aa819d
2 files changed
+22
-1
No files matched your search
+10
-1
@@ -153,7 +153,16 @@ let
|
||||
# systems, while -P 4 is ~30% slower. Cap at 8 but use fewer workers if the
|
||||
# system has fewer cores.
|
||||
mkdir -p ${systemToInstall.config.disko.rootMountPoint}/nix/store
|
||||
P=$(nproc); [ "$P" -gt 8 ] && P=8
|
||||
${
|
||||
if cfg.copyNixStoreThreads == "auto" then
|
||||
''
|
||||
P=$(nproc); [ "$P" -gt 8 ] && P=8
|
||||
''
|
||||
else
|
||||
''
|
||||
P=${toString cfg.copyNixStoreThreads}
|
||||
''
|
||||
}
|
||||
xargs -P "$P" -I {} cp --recursive {} ${systemToInstall.config.disko.rootMountPoint}/nix/store < ${closureInfo}/store-paths
|
||||
|
||||
${systemToInstall.config.system.build.nixos-install}/bin/nixos-install --root ${systemToInstall.config.disko.rootMountPoint} --system ${systemToInstall.config.system.build.toplevel} --keep-going --no-channel-copy -v --no-root-password --option binary-caches ""
|
||||
|
||||
Reference in new issue
Block a user