nixos/qemu-vm: Refactor: Combine duplicate disk definitions
This commit is contained in:
parent
83eb5ed90c
commit
800639f287
|
@ -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";
|
||||
|
|
Loading…
Reference in a new issue