virtualisation-options: init

see header comment in virtualisation-options.nix
This commit is contained in:
phaer
2024-08-30 13:24:22 +02:00
parent 04fadac429
commit 39df221e77
2 changed files with 66 additions and 8 deletions

View File

@@ -325,11 +325,15 @@ let
OVMF = cfg.efi.OVMF;
};
virtualisationOptions = import ./virtualisation-options.nix;
in
{
imports = [
./virtualisation-options.nix
../profiles/qemu-guest.nix
virtualisationOptions.diskSize
(mkRenamedOptionModule
[
"virtualisation"
@@ -385,14 +389,6 @@ in
'';
};
virtualisation.diskSize = mkOption {
type = types.ints.positive;
default = 1024;
description = ''
The disk size in megabytes of the virtual machine.
'';
};
virtualisation.diskImage = mkOption {
type = types.nullOr types.str;
default = "./${config.system.name}.qcow2";
@@ -1238,6 +1234,8 @@ in
# override by setting `virtualisation.fileSystems = lib.mkForce { };`.
fileSystems = lib.mkIf (cfg.fileSystems != { }) (mkVMOverride cfg.fileSystems);
virtualisation.diskSizeAutoSupported = false;
virtualisation.fileSystems =
let
mkSharedDir = tag: share: {