Skip to content

Commit 16f4b39

Browse files
committed
make-disk-image: also use xcp
1 parent bbe357f commit 16f4b39

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/make-disk-image.nix

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ let
4040
nix
4141
util-linux
4242
findutils
43+
(pkgs.xcp.overrideAttrs (old: {
44+
# https://github.com/tarka/xcp/pull/56
45+
patches = (old.patches or []) ++ [
46+
(fetchpatch {
47+
url = "https://github.com/tarka/xcp/commit/8c00cef85c4ae6ffa4f49a59e5f64f68f6407000.patch";
48+
sha256 = "sha256-pwgtA/36YPRtpn4jmOcb44xjiDfEKmpXdJDSvqfGQuk=";
49+
})
50+
];
51+
}))
4352
] ++ cfg.extraDependencies;
4453
preVM = ''
4554
${lib.concatMapStringsSep "\n" (disk: "${pkgs.qemu}/bin/qemu-img create -f ${imageFormat} ${disk.name}.${imageFormat} ${disk.imageSize}") (lib.attrValues diskoCfg.devices.disk)}
@@ -88,7 +97,7 @@ let
8897
8998
# We copy files with cp because `nix copy` seems to have a large memory leak
9099
mkdir -p ${systemToInstall.config.disko.rootMountPoint}/nix/store
91-
xargs cp --recursive --target ${systemToInstall.config.disko.rootMountPoint}/nix/store < ${closureInfo}/store-paths
100+
xargs xcp --recursive --target-directory ${systemToInstall.config.disko.rootMountPoint}/nix/store < ${closureInfo}/store-paths
92101
93102
${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 ""
94103
umount -Rv ${systemToInstall.config.disko.rootMountPoint}

0 commit comments

Comments
 (0)