1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-10 14:50:40 +02:00

feat(topology): add microvm ram amount

This commit is contained in:
oddlama 2024-04-01 14:34:02 +02:00
parent 35643676b4
commit 6866840306
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A

View file

@ -10,6 +10,8 @@
mkEnableOption
mkIf
mkMerge
mkVMOverride
mod
optionalAttrs
;
in {
@ -22,6 +24,14 @@ in {
${vm.config.config.topology.id} = {
guestType = "microvm";
parent = config.topology.id;
hardware.info = let
ramGB10 = builtins.floor (10 * vm.config.config.microvm.mem / 1024);
ramGB =
if mod ramGB10 10 == 0
then ramGB10 / 10
else ramGB10 / 10.0;
in
mkVMOverride "microvm, ${toString ramGB}GB RAM";
};
}
));