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:
parent
a477f18fa6
commit
c6b9d4f99a
3 changed files with 27 additions and 8 deletions
|
|
@ -23,6 +23,7 @@
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
useNetworkd = false;
|
useNetworkd = false;
|
||||||
|
networkmanager.enable = false;
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
|
|
||||||
nftables.enable = true;
|
nftables.enable = true;
|
||||||
|
|
@ -92,6 +93,7 @@
|
||||||
Gateway = "10.16.1.1";
|
Gateway = "10.16.1.1";
|
||||||
DNS = ["10.16.1.1"];
|
DNS = ["10.16.1.1"];
|
||||||
LinkLocalAddressing = "no";
|
LinkLocalAddressing = "no";
|
||||||
|
DHCP = "no";
|
||||||
};
|
};
|
||||||
linkConfig.RequiredForOnline = "routable";
|
linkConfig.RequiredForOnline = "routable";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
2
snow.nix
2
snow.nix
|
|
@ -78,7 +78,7 @@ cerulean.mkNexus ./. (self: {
|
||||||
{
|
{
|
||||||
image = "/var/lib/microvms/home-assistant/data.img";
|
image = "/var/lib/microvms/home-assistant/data.img";
|
||||||
mountPoint = "/var/lib/hass";
|
mountPoint = "/var/lib/hass";
|
||||||
size = 16384; # 16GB
|
autoCreate = false;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
{
|
{
|
||||||
services.home-assistant = {
|
services.home-assistant = {
|
||||||
enable = true;
|
enable = true;
|
||||||
configDir = "/var/lib/hass";
|
configDir = "/var/lib/hass/hass";
|
||||||
|
|
||||||
# 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
|
||||||
|
|
@ -16,15 +16,32 @@
|
||||||
|
|
||||||
extraPackages = python3Packages: with python3Packages; [
|
extraPackages = python3Packages: with python3Packages; [
|
||||||
getmac
|
getmac
|
||||||
|
aiohue
|
||||||
|
numpy
|
||||||
|
aiodhcpwatcher
|
||||||
|
async-upnp-client
|
||||||
|
gtts
|
||||||
|
numpy
|
||||||
|
plexapi
|
||||||
|
pyipp
|
||||||
|
paho-mqtt
|
||||||
|
pyturbojpeg
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
# configures the config directory to be mounted
|
||||||
# configures the config directory to be mounted
|
# correctly with the right permissions
|
||||||
# correclty with the right permissions
|
systemd.services.hass-permissions = {
|
||||||
"z /var/lib/hass 0755 hass hass -"
|
wantedBy = [ "multi-user.target" ];
|
||||||
"z /var/lib/hass/lost+found 0755 hass hass -"
|
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 = {
|
networking = {
|
||||||
nftables.enable = true;
|
nftables.enable = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue