mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
azure-image: use virtualisation.diskSize
This commit is contained in:
parent
759de4c54d
commit
a4b1638f7f
1 changed files with 19 additions and 11 deletions
|
@ -8,20 +8,27 @@
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = config.virtualisation.azureImage;
|
cfg = config.virtualisation.azureImage;
|
||||||
|
virtualisationOptions = import ./virtualisation-options.nix;
|
||||||
in
|
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 = {
|
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 {
|
bootSize = mkOption {
|
||||||
type = types.int;
|
type = types.int;
|
||||||
default = 256;
|
default = 256;
|
||||||
|
@ -67,7 +74,8 @@ in
|
||||||
bootSize = "${toString cfg.bootSize}M";
|
bootSize = "${toString cfg.bootSize}M";
|
||||||
partitionTableType = if cfg.vmGeneration == "v2" then "efi" else "legacy";
|
partitionTableType = if cfg.vmGeneration == "v2" then "efi" else "legacy";
|
||||||
|
|
||||||
inherit (cfg) diskSize contents;
|
inherit (cfg) contents;
|
||||||
|
inherit (config.virtualisation) diskSize;
|
||||||
inherit config lib pkgs;
|
inherit config lib pkgs;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue