1
0
Fork 0
forked from foxora/nix

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

@ -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;