From 1ef51c1d32fdea772913ff239323fd8082a5d820 Mon Sep 17 00:00:00 2001 From: Astro Date: Sun, 4 Dec 2022 21:32:16 +0100 Subject: [PATCH] modules/cluster/deployment: make microvm.hypervisor configurable as requested by marenz --- modules/cluster/deployment-options.nix | 10 ++++++++++ modules/cluster/deployment.nix | 3 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/cluster/deployment-options.nix b/modules/cluster/deployment-options.nix index c7ee785a..2d0379ba 100644 --- a/modules/cluster/deployment-options.nix +++ b/modules/cluster/deployment-options.nix @@ -10,6 +10,16 @@ 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 ( diff --git a/modules/cluster/deployment.nix b/modules/cluster/deployment.nix index ceedabd0..6e77fea5 100644 --- a/modules/cluster/deployment.nix +++ b/modules/cluster/deployment.nix @@ -30,8 +30,7 @@ let in { microvm = { - hypervisor = "cloud-hypervisor"; - inherit (config.deployment) mem vcpu; + inherit (config.deployment) mem vcpu hypervisor; preStart = '' # Discard old writable store overlay