mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-10 23:00:39 +02:00
feat(topology): add microvm ram amount
This commit is contained in:
parent
35643676b4
commit
6866840306
1 changed files with 10 additions and 0 deletions
|
@ -10,6 +10,8 @@
|
||||||
mkEnableOption
|
mkEnableOption
|
||||||
mkIf
|
mkIf
|
||||||
mkMerge
|
mkMerge
|
||||||
|
mkVMOverride
|
||||||
|
mod
|
||||||
optionalAttrs
|
optionalAttrs
|
||||||
;
|
;
|
||||||
in {
|
in {
|
||||||
|
@ -22,6 +24,14 @@ in {
|
||||||
${vm.config.config.topology.id} = {
|
${vm.config.config.topology.id} = {
|
||||||
guestType = "microvm";
|
guestType = "microvm";
|
||||||
parent = config.topology.id;
|
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";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue