azure-image: use virtualisation.diskSize

This commit is contained in:
phaer 2024-09-05 13:06:25 +02:00
parent 759de4c54d
commit a4b1638f7f

View File

@ -8,20 +8,27 @@
with lib;
let
cfg = config.virtualisation.azureImage;
virtualisationOptions = import ./virtualisation-options.nix;
in
{
imports = [ ./azure-common.nix ];
imports = [
./azure-common.nix
virtualisationOptions.diskSize
(lib.mkRenamedOptionModuleWith {
sinceRelease = 2411;
from = [
"virtualisation"
"azureImage"
"diskSize"
];
to = [
"virtualisation"
"diskSize"
];
})
];
options.virtualisation.azureImage = {
diskSize = mkOption {
type = with types; either (enum [ "auto" ]) int;
default = "auto";
example = 2048;
description = ''
Size of disk image. Unit is MB.
'';
};
bootSize = mkOption {
type = types.int;
default = 256;
@ -67,7 +74,8 @@ in
bootSize = "${toString cfg.bootSize}M";
partitionTableType = if cfg.vmGeneration == "v2" then "efi" else "legacy";
inherit (cfg) diskSize contents;
inherit (cfg) contents;
inherit (config.virtualisation) diskSize;
inherit config lib pkgs;
};
};