modules/cluster/customization/options: move types into separate file so that options can be merged on extendModules
This commit is contained in:
parent
ea8bf43313
commit
6ef686ff46
|
@ -29,7 +29,7 @@ let
|
|||
|
||||
in
|
||||
{
|
||||
imports = [ ./options.nix ];
|
||||
imports = [ ./option-types.nix ];
|
||||
|
||||
microvm = {
|
||||
inherit (config.deployment) mem vcpu hypervisor;
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
{ lib, ... }:
|
||||
|
||||
{
|
||||
options.deployment = with lib; {
|
||||
vcpu = mkOption {
|
||||
type = types.int;
|
||||
};
|
||||
mem = mkOption {
|
||||
type = types.int;
|
||||
};
|
||||
hypervisor = mkOption {
|
||||
type = types.enum [
|
||||
"qemu"
|
||||
"cloud-hypervisor"
|
||||
"firecracker"
|
||||
"crosvm"
|
||||
"kvmtool"
|
||||
];
|
||||
};
|
||||
networks = mkOption {
|
||||
type = with types; listOf str;
|
||||
};
|
||||
persistedShares = mkOption {
|
||||
type = with types; listOf str;
|
||||
};
|
||||
extraShares = mkOption {
|
||||
type = with types; listOf (submodule {
|
||||
options = {
|
||||
source = mkOption {
|
||||
type = str;
|
||||
};
|
||||
mountPoint = mkOption {
|
||||
type = str;
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
needForSpeed = mkOption {
|
||||
type = types.bool;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -3,25 +3,15 @@
|
|||
{
|
||||
options.deployment = with lib; {
|
||||
vcpu = mkOption {
|
||||
type = types.int;
|
||||
default = 4;
|
||||
};
|
||||
mem = mkOption {
|
||||
type = types.int;
|
||||
default = 512;
|
||||
};
|
||||
hypervisor = mkOption {
|
||||
type = types.enum [
|
||||
"qemu"
|
||||
"cloud-hypervisor"
|
||||
"firecracker"
|
||||
"crosvm"
|
||||
"kvmtool"
|
||||
];
|
||||
default = "cloud-hypervisor";
|
||||
};
|
||||
networks = mkOption {
|
||||
type = with types; listOf str;
|
||||
default = builtins.attrNames (
|
||||
lib.filterAttrs (_: { hosts4, hosts6, ... }:
|
||||
hosts4 ? ${config.networking.hostName} ||
|
||||
|
@ -32,27 +22,15 @@
|
|||
);
|
||||
};
|
||||
persistedShares = mkOption {
|
||||
type = with types; listOf str;
|
||||
default = [ "/etc" "/home" "/var" ];
|
||||
};
|
||||
extraShares = mkOption {
|
||||
type = with types; listOf (submodule {
|
||||
options = {
|
||||
source = mkOption {
|
||||
type = str;
|
||||
};
|
||||
mountPoint = mkOption {
|
||||
type = str;
|
||||
};
|
||||
};
|
||||
});
|
||||
default = [];
|
||||
description = ''
|
||||
Extra shares. THESE MUST BE AVAILABLE ON ALL MICROVM HOSTS!
|
||||
'';
|
||||
};
|
||||
needForSpeed = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Prefer deployment on Nomad clients with a higher c3d2.cpuSpeed
|
||||
|
|
Loading…
Reference in New Issue