modules/virtualisation: add unified diskSize opt
See https://github.com/NixOS/nixpkgs/pull/339535 and https://github.com/NixOS/nixpkgs/pull/341058
This commit is contained in:
@@ -317,12 +317,11 @@ let
|
||||
copyChannel = false;
|
||||
OVMF = cfg.efi.OVMF;
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
imports = [
|
||||
../profiles/qemu-guest.nix
|
||||
./disk-size-option.nix
|
||||
(mkRenamedOptionModule
|
||||
[
|
||||
"virtualisation"
|
||||
@@ -378,14 +377,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";
|
||||
@@ -1250,6 +1241,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: {
|
||||
|
||||
Reference in New Issue
Block a user