1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 18:21:07 +01:00
Files
niveum/systems/zaatar/home-assistant.nix

48 lines
1.2 KiB
Nix

{config, ...}: let
port = 8123;
inherit (import ../../lib) restic;
influxPort = 9100;
volumeName = "home-assistant.bak";
in {
networking.firewall.allowedTCPPorts = [port influxPort];
services.nginx.virtualHosts."home.kmein.r" = {
locations."/" = {
proxyPass = "http://127.0.0.1:${toString port}";
};
};
services.influxdb = {
enable = true;
extraConfig = {
http.bind-address = ":${toString influxPort}";
};
};
services.restic.backups.niveum = {
initialize = true;
inherit (restic) repository;
timerConfig = {
OnCalendar = "daily";
RandomizedDelaySec = "1h";
};
passwordFile = config.age.secrets.restic.path;
paths = [
"/var/lib/containers/storage/volumes/${volumeName}"
];
};
virtualisation.oci-containers = {
backend = "podman";
containers.homeassistant = {
volumes = ["${volumeName}:/config"];
environment.TZ = "Europe/Berlin";
image = "ghcr.io/home-assistant/home-assistant:stable";
extraOptions = [
"--network=host"
"--device=/dev/ttyACM0:/dev/ttyACM0" # Example, change this to match your own hardware
];
};
};
}