mirror of
https://github.com/nix-community/disko.git
synced 2024-11-09 20:02:37 +03:00
makeDiskImage: add extraPostVM arg
This commit is contained in:
parent
8edfd2295c
commit
5e253d949f
@ -3,6 +3,7 @@
|
|||||||
, pkgs ? nixosConfig.pkgs
|
, pkgs ? nixosConfig.pkgs
|
||||||
, lib ? pkgs.lib
|
, lib ? pkgs.lib
|
||||||
, name ? "${nixosConfig.config.networking.hostName}-disko-images"
|
, name ? "${nixosConfig.config.networking.hostName}-disko-images"
|
||||||
|
, extraPostVM ? ""
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
cleanedConfig = diskoLib.testLib.prepareDiskoConfig nixosConfig.config diskoLib.testLib.devices;
|
cleanedConfig = diskoLib.testLib.prepareDiskoConfig nixosConfig.config diskoLib.testLib.devices;
|
||||||
@ -27,6 +28,7 @@ pkgs.vmTools.runInLinuxVM (pkgs.runCommand name {
|
|||||||
postVM = ''
|
postVM = ''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
${lib.concatMapStringsSep "\n" (disk: "cp ${disk.name}.raw $out/${disk.name}.raw") (lib.attrValues nixosConfig.config.disko.devices.disk)}
|
${lib.concatMapStringsSep "\n" (disk: "cp ${disk.name}.raw $out/${disk.name}.raw") (lib.attrValues nixosConfig.config.disko.devices.disk)}
|
||||||
|
${extraPostVM}
|
||||||
'';
|
'';
|
||||||
QEMU_OPTS = lib.concatMapStringsSep " " (disk: "-drive file=${disk.name}.raw,if=virtio,cache=unsafe,werror=report") (lib.attrValues nixosConfig.config.disko.devices.disk);
|
QEMU_OPTS = lib.concatMapStringsSep " " (disk: "-drive file=${disk.name}.raw,if=virtio,cache=unsafe,werror=report") (lib.attrValues nixosConfig.config.disko.devices.disk);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user