From 140b0d06e1201796830defbe8a5febe6a28c1cd1 Mon Sep 17 00:00:00 2001 From: oddlama Date: Sat, 6 Jan 2024 16:59:08 +0100 Subject: [PATCH] feat: back to qemu, cloud-hypervisor has issues with stopping automatically (kernel panics) and sometimes shared files are not available causing ssh to not work because libraries are missing --- modules/guests/common-guest-config.nix | 11 ++++++++++- modules/guests/microvm.nix | 4 ++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/modules/guests/common-guest-config.nix b/modules/guests/common-guest-config.nix index bce8aac..7a0a904 100644 --- a/modules/guests/common-guest-config.nix +++ b/modules/guests/common-guest-config.nix @@ -1,9 +1,18 @@ -_guestName: guestCfg: {lib, ...}: let +_guestName: guestCfg: { + config, + lib, + ... +}: let inherit (lib) mkForce; in { node.name = guestCfg.nodeName; node.type = guestCfg.backend; + # Set early hostname too, so we can associate those logs to this host and don't get "localhost" entries in loki + boot.kernelParams = lib.mkIf (!config.boot.isContainer) [ + "systemd.hostname=${config.networking.hostName}" + ]; + nix = { settings.auto-optimise-store = mkForce false; optimise.automatic = mkForce false; diff --git a/modules/guests/microvm.nix b/modules/guests/microvm.nix index 9f9bbeb..fe04555 100644 --- a/modules/guests/microvm.nix +++ b/modules/guests/microvm.nix @@ -29,10 +29,10 @@ in { lib.microvm.mac = guestCfg.microvm.mac; microvm = { - hypervisor = mkDefault "cloud-hypervisor"; + hypervisor = mkDefault "qemu"; # Give them some juice by default - mem = mkDefault 2048; + mem = mkDefault (1024 + 2048); # Add a writable store overlay, but since this is always ephemeral # disable any store optimization from nix.