From 861b05b0427cc5ffe315e0463bcc0320324dee4f Mon Sep 17 00:00:00 2001 From: foxora Date: Thu, 19 Feb 2026 18:56:57 +0000 Subject: [PATCH] i need butterfly's help ;-; --- hosts/arcturus/default.nix | 47 ++++++++++++++++++++++++---------- snow.nix | 28 +++++++++++++------- vms/home-assistant/default.nix | 10 +++++++- 3 files changed, 61 insertions(+), 24 deletions(-) diff --git a/hosts/arcturus/default.nix b/hosts/arcturus/default.nix index aa0e179..3cf1dfd 100644 --- a/hosts/arcturus/default.nix +++ b/hosts/arcturus/default.nix @@ -34,24 +34,25 @@ }; }; + systemd.services.systemd-networkd.environment = { + SYSTEMD_LOG_LEVEL = "debug"; + }; + systemd.network = { enable = true; - netdevs = { - "10-bond0" = { - netdevConfig = { - Kind = "bond"; - Name = "bond0"; - }; - bondConfig = { - Mode = "802.3ad"; - TransmitHashPolicy = "layer3+4"; - LACPTransmitRate = "fast"; - MIIMonitorSec = "100ms"; - }; + netdevs."10-bond0" = { + netdevConfig = { + Name = "bond0"; + Kind = "bond"; + }; + bondConfig = { + Mode = "802.3ad"; + TransmitHashPolicy = "layer3+4"; + LACPTransmitRate = "fast"; + MIIMonitorSec = "100ms"; }; }; - networks = { "30-eno1" = { matchConfig.Name = "eno1"; @@ -68,7 +69,25 @@ }; networkConfig.LinkLocalAddressing = "no"; networkConfig.DHCP = "yes"; - vlan = [ "vlan1" ]; + }; + }; + + netdevs."20-br0" = { + netdevConfig = { + Name = "br0"; + Kind = "bridge"; + }; + }; + networks = { + "50-vms" = { + matchConfig.Name = ["bond0" "vm-*"]; + networkConfig = { + Bridge = "br0"; + }; + }; + "50-vms-bridge" = { + matchConfig.Name = "br0"; + linkConfig.RequiredForOnline = "routable"; }; }; }; diff --git a/snow.nix b/snow.nix index 60b53b8..a2be24c 100644 --- a/snow.nix +++ b/snow.nix @@ -47,9 +47,19 @@ cerulean.mkNexus ./. (self: { networking.hostName = "home-assistant"; + boot.kernelParams = ["console=ttyS0" "console=ttyS1" "8250.nr_uarts=2"]; + systemd.services."serial-getty@ttyS1".enable = true; + microvm = { hypervisor = "qemu"; + # needed to get interface working + qemu.extraArgs = [ + "-monitor" "unix:/var/lib/microvms/home-assistant/monitor.sock,server,nowait" + "-chardev" "socket,id=serial1,path=/var/lib/microvms/home-assistant/serial.sock,server=on,wait=off" + "-serial" "chardev:serial1" + ]; + # memory cannot be 2GB so i doubled it and used 4GB: # https://github.com/microvm-nix/microvm.nix/issues/171 # TODO: can be fixed by turning off acpi in qemu @@ -73,15 +83,15 @@ cerulean.mkNexus ./. (self: { ]; }; - networking = { - interfaces.eth0 = { - useDHCP = false; - ipv4.addresses = [ - { - address = "10.16.1.127"; - prefixLength = 24; - } - ]; + systemd.network.enable = true; + systemd.network.networks."20-lan" = { + matchConfig.Type = "ether"; + networkConfig = { + Address = ["10.16.1.127"]; + Gateway = "10.16.1.1"; + DNS = ["10.16.1.1"]; + IPv6AcceptRA = true; + DHCP = "yes"; }; }; }; diff --git a/vms/home-assistant/default.nix b/vms/home-assistant/default.nix index 4f27018..ef3ad3b 100644 --- a/vms/home-assistant/default.nix +++ b/vms/home-assistant/default.nix @@ -2,11 +2,19 @@ { services.home-assistant = { enable = true; - configDir = "/var/lib/hass"; + configDir = "/var/lib/microvms/home-assistant"; # disables config generation, i don't wanna configure home assistant # through nix at the moment config = null; }; + users.users.nixos = { + isNormalUser = true; + uid = 1000; + extraGroups = ["wheel"]; + + hashedPassword = "$2b$05$94fPE/15g7ix7glKOaN0AeVMpitMivtQtcFL.aZIouQngOJ6nGMSC"; + }; + system.stateVersion = "25.11"; }