mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-14 05:29:20 +03:00
make-disk-image: embed compression switch into the format name
This commit is contained in:
parent
608de48fe4
commit
27f5cc959b
1 changed files with 6 additions and 6 deletions
|
@ -33,17 +33,17 @@
|
||||||
|
|
||||||
, name ? "nixos-disk-image"
|
, name ? "nixos-disk-image"
|
||||||
|
|
||||||
, # Disk image format, one of qcow2, vpc, raw.
|
, # Disk image format, one of qcow2, qcow2-compressed, vpc, raw.
|
||||||
format ? "raw"
|
format ? "raw"
|
||||||
|
|
||||||
, # Whether to compress the image, applicable only when the format is qcow2.
|
|
||||||
compressed ? false
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let format' = format; in let
|
||||||
compress = optionalString compressed (assert format == "qcow2"; "-c");
|
|
||||||
|
format = if (format' == "qcow2-compressed") then "qcow2" else format;
|
||||||
|
|
||||||
|
compress = optionalString (format' == "qcow2-compressed") "-c";
|
||||||
|
|
||||||
filename = "nixos." + {
|
filename = "nixos." + {
|
||||||
qcow2 = "qcow2";
|
qcow2 = "qcow2";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue