google-compute-image: use virtualisation.diskSize
This commit is contained in:
@@ -16,21 +16,28 @@ let
|
||||
];
|
||||
}
|
||||
'';
|
||||
virtualisationOptions = import ./virtualisation-options.nix;
|
||||
in
|
||||
{
|
||||
|
||||
imports = [ ./google-compute-config.nix ];
|
||||
imports = [
|
||||
./google-compute-config.nix
|
||||
virtualisationOptions.diskSize
|
||||
(lib.mkRenamedOptionModuleWith {
|
||||
sinceRelease = 2411;
|
||||
from = [
|
||||
"virtualisation"
|
||||
"googleComputeImage"
|
||||
"diskSize"
|
||||
];
|
||||
to = [
|
||||
"virtualisation"
|
||||
"diskSize"
|
||||
];
|
||||
})
|
||||
];
|
||||
|
||||
options = {
|
||||
virtualisation.googleComputeImage.diskSize = mkOption {
|
||||
type = with types; either (enum [ "auto" ]) int;
|
||||
default = "auto";
|
||||
example = 1536;
|
||||
description = ''
|
||||
Size of disk image. Unit is MB.
|
||||
'';
|
||||
};
|
||||
|
||||
virtualisation.googleComputeImage.configFile = mkOption {
|
||||
type = with types; nullOr str;
|
||||
default = null;
|
||||
@@ -86,7 +93,7 @@ in
|
||||
format = "raw";
|
||||
configFile = if cfg.configFile == null then defaultConfigFile else cfg.configFile;
|
||||
partitionTableType = if cfg.efi then "efi" else "legacy";
|
||||
inherit (cfg) diskSize;
|
||||
inherit (config.virtualisation) diskSize;
|
||||
inherit config lib pkgs;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user