From dbcfb41bd025a9a05423ac278851706623192800 Mon Sep 17 00:00:00 2001 From: Morgan Helton Date: Sun, 30 Aug 2026 11:18:01 -0500 Subject: [PATCH] feat(chopper): add an echoip microvm guest echoip is trivial enough that it makes plain whether a guest booted and reached the network, which makes it a reasonable first VM on the host support added previously. It takes a static address from below the DHCP pool, so Kea has nothing to hand out, and a vsock CID of 3. Everything else comes from common.nix. --- hosts/chopper/microvm/default.nix | 1 + hosts/chopper/microvm/echoip.nix | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 hosts/chopper/microvm/echoip.nix diff --git a/hosts/chopper/microvm/default.nix b/hosts/chopper/microvm/default.nix index cc4934c..bcf855c 100644 --- a/hosts/chopper/microvm/default.nix +++ b/hosts/chopper/microvm/default.nix @@ -2,6 +2,7 @@ { imports = [ inputs.microvm.nixosModules.host + ./echoip.nix ]; users.users.microvm.extraGroups = [ "tailscale-key" ]; diff --git a/hosts/chopper/microvm/echoip.nix b/hosts/chopper/microvm/echoip.nix new file mode 100644 index 0000000..253a954 --- /dev/null +++ b/hosts/chopper/microvm/echoip.nix @@ -0,0 +1,25 @@ +{ ... }: +{ + microvm.vms.echoip = { + extraModules = [ ./common.nix ]; + config = { + microvm = { + vcpu = 1; + mem = 512; + vsock.cid = 3; + interfaces = [ + { + type = "tap"; + id = "vm-echoip"; + mac = "02:00:00:00:20:01"; + } + ]; + }; + + systemd.network.networks."20-lan".address = [ "192.168.20.50/23" ]; + + services.echoip.enable = true; + networking.firewall.allowedTCPPorts = [ 8080 ]; + }; + }; +}