1
0
Fork 0
forked from foxora/nix

i need butterfly's help ;-;

This commit is contained in:
foxora 2026-02-19 18:56:57 +00:00
parent 21cb58686e
commit 861b05b042
3 changed files with 61 additions and 24 deletions

View file

@ -34,24 +34,25 @@
}; };
}; };
systemd.services.systemd-networkd.environment = {
SYSTEMD_LOG_LEVEL = "debug";
};
systemd.network = { systemd.network = {
enable = true; enable = true;
netdevs = { netdevs."10-bond0" = {
"10-bond0" = { netdevConfig = {
netdevConfig = { Name = "bond0";
Kind = "bond"; Kind = "bond";
Name = "bond0"; };
}; bondConfig = {
bondConfig = { Mode = "802.3ad";
Mode = "802.3ad"; TransmitHashPolicy = "layer3+4";
TransmitHashPolicy = "layer3+4"; LACPTransmitRate = "fast";
LACPTransmitRate = "fast"; MIIMonitorSec = "100ms";
MIIMonitorSec = "100ms";
};
}; };
}; };
networks = { networks = {
"30-eno1" = { "30-eno1" = {
matchConfig.Name = "eno1"; matchConfig.Name = "eno1";
@ -68,7 +69,25 @@
}; };
networkConfig.LinkLocalAddressing = "no"; networkConfig.LinkLocalAddressing = "no";
networkConfig.DHCP = "yes"; 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";
}; };
}; };
}; };

View file

@ -47,9 +47,19 @@ cerulean.mkNexus ./. (self: {
networking.hostName = "home-assistant"; networking.hostName = "home-assistant";
boot.kernelParams = ["console=ttyS0" "console=ttyS1" "8250.nr_uarts=2"];
systemd.services."serial-getty@ttyS1".enable = true;
microvm = { microvm = {
hypervisor = "qemu"; 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: # memory cannot be 2GB so i doubled it and used 4GB:
# https://github.com/microvm-nix/microvm.nix/issues/171 # https://github.com/microvm-nix/microvm.nix/issues/171
# TODO: can be fixed by turning off acpi in qemu # TODO: can be fixed by turning off acpi in qemu
@ -73,15 +83,15 @@ cerulean.mkNexus ./. (self: {
]; ];
}; };
networking = { systemd.network.enable = true;
interfaces.eth0 = { systemd.network.networks."20-lan" = {
useDHCP = false; matchConfig.Type = "ether";
ipv4.addresses = [ networkConfig = {
{ Address = ["10.16.1.127"];
address = "10.16.1.127"; Gateway = "10.16.1.1";
prefixLength = 24; DNS = ["10.16.1.1"];
} IPv6AcceptRA = true;
]; DHCP = "yes";
}; };
}; };
}; };

View file

@ -2,11 +2,19 @@
{ {
services.home-assistant = { services.home-assistant = {
enable = true; enable = true;
configDir = "/var/lib/hass"; configDir = "/var/lib/microvms/home-assistant";
# disables config generation, i don't wanna configure home assistant # disables config generation, i don't wanna configure home assistant
# through nix at the moment # through nix at the moment
config = null; config = null;
}; };
users.users.nixos = {
isNormalUser = true;
uid = 1000;
extraGroups = ["wheel"];
hashedPassword = "$2b$05$94fPE/15g7ix7glKOaN0AeVMpitMivtQtcFL.aZIouQngOJ6nGMSC";
};
system.stateVersion = "25.11"; system.stateVersion = "25.11";
} }