linode-image: use virtualisation.diskSize

This commit is contained in:
phaer 2024-09-05 13:06:09 +02:00
parent 564b6ce153
commit 048599f0d7

View file

@ -15,19 +15,27 @@ let
];
}
'';
virtualisationOptions = import ./virtualisation-options.nix;
in
{
imports = [ ./linode-config.nix ];
imports = [
./linode-config.nix
virtualisationOptions.diskSize
(lib.mkRenamedOptionModuleWith {
sinceRelease = 2411;
from = [
"virtualisation"
"linodeImage"
"diskSize"
];
to = [
"virtualisation"
"diskSize"
];
})
];
options = {
virtualisation.linodeImage.diskSize = mkOption {
type = with types; either (enum (singleton "auto")) ints.positive;
default = "auto";
example = 1536;
description = ''
Size of disk image in MB.
'';
};
virtualisation.linodeImage.configFile = mkOption {
type = with types; nullOr str;
@ -62,7 +70,7 @@ in
format = "raw";
partitionTableType = "none";
configFile = if cfg.configFile == null then defaultConfigFile else cfg.configFile;
inherit (cfg) diskSize;
inherit (config.virtualisation) diskSize;
inherit config lib pkgs;
};
};