nixos/qemu-vm: add option to use a non-standard BIOS

I'd like to change the default on x86 platforms to qboot at some point, since it
saves a fair bit of startup time.
This commit is contained in:
Jamie McClymont
2020-06-08 11:21:53 +12:00
parent 2defee2981
commit 55912f3535
4 changed files with 32 additions and 1 deletions
+15
View File
@@ -441,6 +441,18 @@ in
'';
};
virtualisation.bios =
mkOption {
default = null;
type = types.nullOr types.package;
description =
''
An alternate BIOS (such as <package>qboot</package>) with which to start the VM.
Should containin a file named <literal>bios.bin</literal>.
If <literal>null</literal>, QEMU's builtin SeaBIOS will be used.
'';
};
};
config = {
@@ -521,6 +533,9 @@ in
(mkIf cfg.useEFIBoot [
"-pflash $TMPDIR/bios.bin"
])
(mkIf (cfg.bios != null) [
"-bios ${cfg.bios}/bios.bin"
])
(mkIf (!cfg.graphics) [
"-nographic"
])