Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 26 additions & 24 deletions src/src/hosts/dummy/modules/constants/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,6 @@
};

vm = {
cpu = {
cores = lib.mkOption {
default = 4;
description = "Number of CPU cores";
type = lib.types.int;
};
};

disk = {
size = lib.mkOption {
default = 8192;
description = "Size of the disk in MB";
type = lib.types.int;
};
};

memory = {
size = lib.mkOption {
default = 4096;
description = "Size of the memory in MB";
type = lib.types.int;
};
};

name = lib.mkOption {
default = "dummy-vm";
description = "Name of the virtual machine";
Expand All @@ -86,6 +62,32 @@
type = lib.types.str;
};
};

resources = {
cpu = {
cores = lib.mkOption {
default = 4;
description = "Number of CPU cores";
type = lib.types.int;
};
};

disk = {
size = lib.mkOption {
default = 8192;
description = "Size of the disk in MB";
type = lib.types.int;
};
};

memory = {
size = lib.mkOption {
default = 4096;
description = "Size of the memory in MB";
type = lib.types.int;
};
};
};
};
};
};
Expand Down
6 changes: 3 additions & 3 deletions src/src/hosts/dummy/modules/vm/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@

virtualisation = {
# CPU cores for the virtual machine
cores = config.virtualisation.vmVariant.constants.vm.cpu.cores;
cores = config.virtualisation.vmVariant.constants.vm.resources.cpu.cores;

# Path to the disk image
diskImage = "./bin/${config.virtualisation.vmVariant.constants.vm.name}.qcow2";

# Size of the disk image
diskSize = config.virtualisation.vmVariant.constants.vm.disk.size;
diskSize = config.virtualisation.vmVariant.constants.vm.resources.disk.size;

# Memory size for the virtual machine
memorySize = config.virtualisation.vmVariant.constants.vm.memory.size;
memorySize = config.virtualisation.vmVariant.constants.vm.resources.memory.size;

# Shared directories between the virtual machine and your development machine
sharedDirectories = {
Expand Down
Loading