3
0
Fork 0
forked from mirrors/nixpkgs

nixos/qemu-vm: Refactor: Combine duplicate disk definitions

This commit is contained in:
Chuck 2020-01-28 13:54:46 -08:00
parent 83eb5ed90c
commit 800639f287

View file

@ -542,25 +542,18 @@ in
];
virtualisation.qemu.drives = mkMerge [
[{
file = "$NIX_DISK_IMAGE";
driveExtraOpts.cache = "writeback";
driveExtraOpts.werror = "report";
}]
(mkIf cfg.useBootLoader [
{
file = "$NIX_DISK_IMAGE";
driveExtraOpts.cache = "writeback";
driveExtraOpts.werror = "report";
}
{
file = "$TMPDIR/disk.img";
driveExtraOpts.media = "disk";
deviceExtraOpts.bootindex = "1";
}
])
(mkIf (!cfg.useBootLoader) [
{
file = "$NIX_DISK_IMAGE";
driveExtraOpts.cache = "writeback";
driveExtraOpts.werror = "report";
}
])
(imap0 (idx: _: {
file = "$(pwd)/empty${toString idx}.qcow2";
driveExtraOpts.werror = "report";