mirror of
https://github.com/nix-community/disko.git
synced 2026-12-02 22:13:28 +01:00
interactive-vm: use disk.imageName instead of .name
Avoids a "No such file or directory" if a configuration uses a named disk image.
This commit is contained in:
1 parent
f6dbc8952d
commit
329d3d7e8b
1 file changed
+4
-4
@@ -28,7 +28,7 @@ let
|
|||||||
disks = lib.attrValues cfg_.disko.devices.disk;
|
disks = lib.attrValues cfg_.disko.devices.disk;
|
||||||
rootDisk = {
|
rootDisk = {
|
||||||
name = "root";
|
name = "root";
|
||||||
file = ''"$tmp"/${lib.escapeShellArg (builtins.head disks).name}.qcow2'';
|
file = ''"$tmp"/${lib.escapeShellArg (builtins.head disks).imageName}.qcow2'';
|
||||||
driveExtraOpts.cache = "writeback";
|
driveExtraOpts.cache = "writeback";
|
||||||
driveExtraOpts.werror = "report";
|
driveExtraOpts.werror = "report";
|
||||||
deviceExtraOpts.bootindex = "1";
|
deviceExtraOpts.bootindex = "1";
|
||||||
@@ -36,7 +36,7 @@ let
|
|||||||
};
|
};
|
||||||
otherDisks = map (disk: {
|
otherDisks = map (disk: {
|
||||||
name = disk.name;
|
name = disk.name;
|
||||||
file = ''"$tmp"/${lib.escapeShellArg disk.name}.qcow2'';
|
file = ''"$tmp"/${lib.escapeShellArg disk.imageName}.qcow2'';
|
||||||
driveExtraOpts.werror = "report";
|
driveExtraOpts.werror = "report";
|
||||||
}) (builtins.tail disks);
|
}) (builtins.tail disks);
|
||||||
|
|
||||||
@@ -78,8 +78,8 @@ in
|
|||||||
trap 'rm -rf "$tmp"' EXIT
|
trap 'rm -rf "$tmp"' EXIT
|
||||||
${lib.concatMapStringsSep "\n" (disk: ''
|
${lib.concatMapStringsSep "\n" (disk: ''
|
||||||
${hostPkgs.qemu}/bin/qemu-img create -f qcow2 \
|
${hostPkgs.qemu}/bin/qemu-img create -f qcow2 \
|
||||||
-b ${config.system.build.diskoImages}/${lib.escapeShellArg disk.name}.qcow2 \
|
-b ${config.system.build.diskoImages}/${lib.escapeShellArg disk.imageName}.qcow2 \
|
||||||
-F qcow2 "$tmp"/${lib.escapeShellArg disk.name}.qcow2
|
-F qcow2 "$tmp"/${lib.escapeShellArg disk.imageName}.qcow2
|
||||||
'') disks}
|
'') disks}
|
||||||
set +f
|
set +f
|
||||||
${config.system.build.vm}/bin/run-*-vm
|
${config.system.build.vm}/bin/run-*-vm
|
||||||
|
|||||||
Reference in new issue
Block a user