make-disk-image: Allow passing of image baseName
It's currently alsways "nixos", which leads to various schemes of renaming the resulting files in virtualisation/*-image.nix files as well as further downstream, outside of nixpkgs.
This commit is contained in:
@@ -163,6 +163,9 @@ To solve this, you can run `fdisk -l $image` and generate `dd if=$image of=$imag
|
|||||||
, # Disk image format, one of qcow2, qcow2-compressed, vdi, vpc, raw.
|
, # Disk image format, one of qcow2, qcow2-compressed, vdi, vpc, raw.
|
||||||
format ? "raw"
|
format ? "raw"
|
||||||
|
|
||||||
|
, # Disk image filename, without any extensions (e.g. `image_1`).
|
||||||
|
baseName ? "nixos"
|
||||||
|
|
||||||
# Whether to fix:
|
# Whether to fix:
|
||||||
# - GPT Disk Unique Identifier (diskGUID)
|
# - GPT Disk Unique Identifier (diskGUID)
|
||||||
# - GPT Partition Unique Identifier: depends on the layout, root partition UUID can be controlled through `rootGPUID` option
|
# - GPT Partition Unique Identifier: depends on the layout, root partition UUID can be controlled through `rootGPUID` option
|
||||||
@@ -208,7 +211,7 @@ let format' = format; in let
|
|||||||
|
|
||||||
compress = lib.optionalString (format' == "qcow2-compressed") "-c";
|
compress = lib.optionalString (format' == "qcow2-compressed") "-c";
|
||||||
|
|
||||||
filename = "nixos." + {
|
filename = "${baseName}." + {
|
||||||
qcow2 = "qcow2";
|
qcow2 = "qcow2";
|
||||||
vdi = "vdi";
|
vdi = "vdi";
|
||||||
vpc = "vhd";
|
vpc = "vhd";
|
||||||
|
|||||||
Reference in New Issue
Block a user