diff --git a/nixos/lib/make-disk-image.nix b/nixos/lib/make-disk-image.nix index 5e86ea479d5..feb6d194022 100644 --- a/nixos/lib/make-disk-image.nix +++ b/nixos/lib/make-disk-image.nix @@ -185,7 +185,8 @@ let format' = format; in let --system ${config.system.build.toplevel} --channel ${channelSources} --substituters "" echo "copying staging root to image..." - cptofs -p ${optionalString (partitionTableType != "none") "-P ${rootPartition}"} -t ${fsType} -i $diskImage $root/* / + cptofs -p ${optionalString (partitionTableType != "none") "-P ${rootPartition}"} -t ${fsType} -i $diskImage $root/* / || + (echo "ERROR: cptofs failed. diskSize might be too small for closure."; exit 1) ''; in pkgs.vmTools.runInLinuxVM ( pkgs.runCommand name