From 4ee7a916100864699367e84dc259c41ddb392ca3 Mon Sep 17 00:00:00 2001 From: Petru Paler Date: Thu, 19 Sep 2024 09:33:48 +0100 Subject: [PATCH] WIP: qemu setup for hassos --- hosts/chilly/default.nix | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/hosts/chilly/default.nix b/hosts/chilly/default.nix index cfb21b4..cf8f43b 100644 --- a/hosts/chilly/default.nix +++ b/hosts/chilly/default.nix @@ -20,13 +20,39 @@ networking.hostName = "chilly"; services.tailscaleAutoconnect.authkey = "tskey-auth-kRXS9oPyPm11CNTRL-BE6YnbP9J6ZZuV9dHkX17ZMnm1JGdu93"; - services.consul.interface.advertise = lib.mkForce "enp1s0"; + services.consul.interface.advertise = lib.mkForce "br0"; + + virtualisation.libvirtd = { + enable = true; + allowedBridges = [ "br0" ]; + }; - virtualisation.libvirtd.enable = true; environment.systemPackages = with pkgs; [ - virt-manager + unstable.qemu usbutils + virt-manager + (pkgs.writeShellScriptBin "qemu-system-x86_64-uefi" '' + qemu-system-x86_64 \ + -bios ${pkgs.OVMF.fd}/FV/OVMF.fd \ + "$@" + '') ]; users.users.ppetru.extraGroups = [ "libvirtd" ]; + + networking = { + # TODO: try using DHCP for br0. will probably need a hardcoded MAC + defaultGateway = "192.168.1.1"; + nameservers = [ "192.168.1.1" ]; + bridges.br0.interfaces = [ "enp1s0" ]; + interfaces.br0 = { + useDHCP = false; + ipv4.addresses = [ + { + "address" = "192.168.1.5"; + "prefixLength" = 24; + } + ]; + }; + }; }