Skip to content

Commit 956f09d

Browse files
committed
make-disk-image: also use xcp
1 parent 00f9f7f commit 956f09d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/make-disk-image.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
, lib
44
, extendModules
55
, options
6+
, pkgs
67
, ...
78
}:
89
let
@@ -11,6 +12,10 @@ let
1112
inherit (cfg) pkgs imageFormat;
1213
checked = diskoCfg.checkScripts;
1314

15+
xcp' = pkgs.callPackage ../xcp.nix {
16+
inherit (pkgs) xcp;
17+
};
18+
1419
configSupportsZfs = config.boot.supportedFilesystems.zfs or false;
1520
vmTools = pkgs.vmTools.override
1621
{
@@ -46,6 +51,7 @@ let
4651
util-linux
4752
findutils
4853
kmod
54+
xcp'
4955
] ++ cfg.extraDependencies;
5056
preVM = ''
5157
${lib.concatMapStringsSep "\n" (disk: "${pkgs.qemu}/bin/qemu-img create -f ${imageFormat} ${disk.imageName}.${imageFormat} ${disk.imageSize}") (lib.attrValues diskoCfg.devices.disk)}
@@ -94,7 +100,7 @@ let
94100
95101
# We copy files with cp because `nix copy` seems to have a large memory leak
96102
mkdir -p ${systemToInstall.config.disko.rootMountPoint}/nix/store
97-
xargs cp --recursive --target ${systemToInstall.config.disko.rootMountPoint}/nix/store < ${closureInfo}/store-paths
103+
xargs xcp --recursive --target-directory ${systemToInstall.config.disko.rootMountPoint}/nix/store < ${closureInfo}/store-paths
98104
99105
${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 ""
100106
umount -Rv ${systemToInstall.config.disko.rootMountPoint}

0 commit comments

Comments
 (0)