From 718565dfbb8e43fd6d4d52416ffc90e3a1326836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 7 May 2024 08:32:47 +0200 Subject: [PATCH] drop dependency on xcp It's actually not faster in combination with xargs... --- disko-install | 8 ++------ lib/make-disk-image.nix | 3 +-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/disko-install b/disko-install index 19a13bc..e2b67c3 100755 --- a/disko-install +++ b/disko-install @@ -235,12 +235,8 @@ main() { if [[ ! -d "${mountPoint}/nix/store" ]]; then export NIX_STATE_DIR=${mountPoint}/nix/var/nix echo "Copying store paths" >&2 - - if [ -t 1 ]; then - xargs -I% xcp --recursive % "${mountPoint}/nix/store" < "${closure_info}/store-paths" - else - xargs -I% xcp --recursive --no-progress % "${mountPoint}/nix/store" < "${closure_info}/store-paths" - fi + mkdir -p "${mountPoint}/nix/store" + xargs cp --recursive --target "${mountPoint}/nix/store" < "${closure_info}/store-paths" echo "Loading nix database" >&2 nix-store --load-db < "${closure_info}/registration" unset NIX_STATE_DIR diff --git a/lib/make-disk-image.nix b/lib/make-disk-image.nix index c9b42f9..26f0d51 100644 --- a/lib/make-disk-image.nix +++ b/lib/make-disk-image.nix @@ -28,7 +28,6 @@ let systemdMinimal nix util-linux - xcp ] ++ nixosConfig.config.disko.extraDependencies; preVM = '' ${lib.concatMapStringsSep "\n" (disk: "truncate -s ${disk.imageSize} ${disk.name}.raw") (lib.attrValues nixosConfig.config.disko.devices.disk)} @@ -68,7 +67,7 @@ let # We copy files with cp because `nix copy` seems to have a large memory leak mkdir -p ${systemToInstall.config.disko.rootMountPoint}/nix/store - xargs -I % xcp --recursive % ${systemToInstall.config.disko.rootMountPoint}/nix/store < ${closureInfo}/store-paths + xargs cp --recursive --target ${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 "" umount -Rv ${systemToInstall.config.disko.rootMountPoint}