fixed ip changing on reboot and added stuff to make home assistant not hang on setup

This commit is contained in:
foxora 2026-02-21 17:03:47 +00:00
parent a477f18fa6
commit c6b9d4f99a
3 changed files with 27 additions and 8 deletions

View file

@ -23,6 +23,7 @@
networking = {
useNetworkd = false;
networkmanager.enable = false;
useDHCP = false;
nftables.enable = true;
@ -92,6 +93,7 @@
Gateway = "10.16.1.1";
DNS = ["10.16.1.1"];
LinkLocalAddressing = "no";
DHCP = "no";
};
linkConfig.RequiredForOnline = "routable";
};

View file

@ -78,7 +78,7 @@ cerulean.mkNexus ./. (self: {
{
image = "/var/lib/microvms/home-assistant/data.img";
mountPoint = "/var/lib/hass";
size = 16384; # 16GB
autoCreate = false;
}
];
};

View file

@ -2,7 +2,7 @@
{
services.home-assistant = {
enable = true;
configDir = "/var/lib/hass";
configDir = "/var/lib/hass/hass";
# disables config generation, i don't wanna configure home assistant
# through nix at the moment
@ -16,15 +16,32 @@
extraPackages = python3Packages: with python3Packages; [
getmac
aiohue
numpy
aiodhcpwatcher
async-upnp-client
gtts
numpy
plexapi
pyipp
paho-mqtt
pyturbojpeg
];
};
systemd.tmpfiles.rules = [
# configures the config directory to be mounted
# correclty with the right permissions
"z /var/lib/hass 0755 hass hass -"
"z /var/lib/hass/lost+found 0755 hass hass -"
];
# configures the config directory to be mounted
# correctly with the right permissions
systemd.services.hass-permissions = {
wantedBy = [ "multi-user.target" ];
after = [ "var-lib-hass.mount" ];
requires = [ "var-lib-hass.mount" ];
before = [ "home-assistant.service" ];
serviceConfig = {
Type = "oneshot";
ExecStart = "${pkgs.bash}/bin/bash -c 'mkdir -p /var/lib/hass/hass && chown hass:hass /var/lib/hass/hass'";
RemainAfterExit = true;
};
};
networking = {
nftables.enable = true;