mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 19:55:41 +03:00
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:
parent
6071ee8e31
commit
c6da9ef32d
14 changed files with 231 additions and 117 deletions
|
@ -10,18 +10,24 @@ let
|
|||
cfg = config.virtualisation.azureImage;
|
||||
in
|
||||
{
|
||||
imports = [ ./azure-common.nix ];
|
||||
imports = [
|
||||
./azure-common.nix
|
||||
./disk-size-option.nix
|
||||
(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 +73,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;
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue