uvms: add --mem
Yeah, yeah, I know, it's stupid, adding add_argument() statements manually, et c. I'll throw the whole Python thing away whenever I might have the time
This commit is contained in:
parent
db4e7809d1
commit
cf95fd33b0
2 changed files with 143 additions and 98 deletions
|
|
@ -301,121 +301,146 @@ in
|
|||
};
|
||||
uvms.ch.settings = mkOption {
|
||||
default = { };
|
||||
type = types.submodule {
|
||||
freeformType = jsonType;
|
||||
options = {
|
||||
payload = {
|
||||
cmdline = mkOption {
|
||||
type = types.str;
|
||||
default = concatStringsSep " " (
|
||||
config.boot.kernelParams
|
||||
++ [
|
||||
# "init=${lib.removePrefix "/nix/store" "${config.system.build.toplevel}"}/init"
|
||||
"init=${config.system.build.toplevel}/init"
|
||||
]
|
||||
);
|
||||
defaultText = ''concatStringsSep " " ${config.boot.kernelParams}'';
|
||||
type = types.submodule (
|
||||
let
|
||||
osConfig = config;
|
||||
in
|
||||
{ config, ... }:
|
||||
{
|
||||
freeformType = jsonType;
|
||||
options = {
|
||||
payload = {
|
||||
cmdline = mkOption {
|
||||
type = types.str;
|
||||
default = concatStringsSep " " (
|
||||
osConfig.boot.kernelParams
|
||||
++ [
|
||||
# "init=${lib.removePrefix "/nix/store" "${osConfig.system.build.toplevel}"}/init"
|
||||
"init=${osConfig.system.build.toplevel}/init"
|
||||
]
|
||||
);
|
||||
defaultText = ''concatStringsSep " " ${osConfig.boot.kernelParams}'';
|
||||
};
|
||||
kernel = mkOption {
|
||||
type = types.str;
|
||||
default = "${kernel}/${kernelTarget}";
|
||||
};
|
||||
initramfs = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = "${initialRamdisk}/${initrdFile}";
|
||||
};
|
||||
};
|
||||
kernel = mkOption {
|
||||
type = types.str;
|
||||
default = "${kernel}/${kernelTarget}";
|
||||
vsock = {
|
||||
cid = mkOption {
|
||||
type = types.int;
|
||||
default = 4;
|
||||
};
|
||||
socket = mkOption {
|
||||
type = types.str;
|
||||
default = "vsock.sock";
|
||||
};
|
||||
};
|
||||
initramfs = mkOption {
|
||||
"api-socket" = mkOption {
|
||||
type = types.str;
|
||||
default = "vmm.sock";
|
||||
};
|
||||
"serial".mode = mkOption {
|
||||
type = types.str;
|
||||
default = "File";
|
||||
};
|
||||
"serial".file = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = "${initialRamdisk}/${initrdFile}";
|
||||
default = "serial";
|
||||
};
|
||||
};
|
||||
vsock = {
|
||||
cid = mkOption {
|
||||
type = types.int;
|
||||
default = 4;
|
||||
};
|
||||
socket = mkOption {
|
||||
"console".mode = mkOption {
|
||||
type = types.str;
|
||||
default = "vsock.sock";
|
||||
default = "Pty";
|
||||
};
|
||||
};
|
||||
"api-socket" = mkOption {
|
||||
type = types.str;
|
||||
default = "vmm.sock";
|
||||
};
|
||||
"serial".mode = mkOption {
|
||||
type = types.str;
|
||||
default = "File";
|
||||
};
|
||||
"serial".file = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = "serial";
|
||||
};
|
||||
"console".mode = mkOption {
|
||||
type = types.str;
|
||||
default = "Pty";
|
||||
};
|
||||
"console".file = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
# "watchdog" = true;
|
||||
# "seccomp" = true;
|
||||
disks = mkOption {
|
||||
default = [ ];
|
||||
type = types.listOf (
|
||||
types.submodule {
|
||||
"console".file = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
};
|
||||
# "watchdog" = true;
|
||||
# "seccomp" = true;
|
||||
disks = mkOption {
|
||||
default = [ ];
|
||||
type = types.listOf (
|
||||
types.submodule {
|
||||
freeformType = jsonType;
|
||||
options = {
|
||||
path = mkOption {
|
||||
type = types.oneOf [
|
||||
types.path
|
||||
types.str
|
||||
];
|
||||
};
|
||||
readonly = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
id = mkOption { type = types.str; };
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
memory = mkOption {
|
||||
default = { };
|
||||
type = types.submodule {
|
||||
freeformType = jsonType;
|
||||
options = {
|
||||
path = mkOption {
|
||||
type = types.oneOf [
|
||||
types.path
|
||||
types.str
|
||||
];
|
||||
size = mkOption {
|
||||
type = types.int;
|
||||
default = 2 * 1024 * 1048576;
|
||||
};
|
||||
readonly = mkOption {
|
||||
shared = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
id = mkOption { type = types.str; };
|
||||
mergeable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
hotplug_method = mkOption {
|
||||
default = "VirtioMem";
|
||||
type = types.enum [
|
||||
"Acpi"
|
||||
"VirtioMem"
|
||||
];
|
||||
};
|
||||
hotplugged_size = mkOption {
|
||||
type = types.int;
|
||||
default = 512 * 1048576;
|
||||
};
|
||||
hotplug_size = mkOption {
|
||||
type = types.int;
|
||||
default = config.memory.size;
|
||||
};
|
||||
# hugepages = mkOption {
|
||||
# type = types.bool;
|
||||
# default = true;
|
||||
# };
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
memory = mkOption {
|
||||
default = { };
|
||||
type = types.submodule {
|
||||
freeformType = jsonType;
|
||||
options = {
|
||||
size = mkOption {
|
||||
type = types.int;
|
||||
default = 3 * 1024 * 1048576;
|
||||
};
|
||||
shared = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
mergeable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
cpus = mkOption {
|
||||
default = { };
|
||||
type = types.submodule {
|
||||
freeformType = jsonType;
|
||||
options = {
|
||||
boot_vcpus = mkOption {
|
||||
type = types.int;
|
||||
default = 4;
|
||||
};
|
||||
max_vcpus = mkOption {
|
||||
type = types.int;
|
||||
default = 4;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
cpus = mkOption {
|
||||
default = { };
|
||||
type = types.submodule {
|
||||
freeformType = jsonType;
|
||||
options = {
|
||||
boot_vcpus = mkOption {
|
||||
type = types.int;
|
||||
default = 4;
|
||||
};
|
||||
max_vcpus = mkOption {
|
||||
type = types.int;
|
||||
default = 4;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue