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

48 lines
1.2 KiB
Nix
Raw Normal View History

2023-07-12 12:28:45 +02:00
{config, ...}: let
port = 8123;
2023-07-12 12:28:45 +02:00
inherit (import ../../lib) restic;
2023-09-03 17:50:48 +02:00
influxPort = 9100;
2023-07-31 22:26:11 +02:00
volumeName = "home-assistant.bak";
in {
2023-09-03 17:50:48 +02:00
networking.firewall.allowedTCPPorts = [port influxPort];
services.nginx.virtualHosts."home.kmein.r" = {
locations."/" = {
proxyPass = "http://127.0.0.1:${toString port}";
};
};
2023-09-03 17:50:48 +02:00
services.influxdb = {
enable = true;
extraConfig = {
http.bind-address = ":${toString influxPort}";
};
};
2023-07-12 12:28:45 +02:00
services.restic.backups.niveum = {
initialize = true;
inherit (restic) repository;
timerConfig = {
OnCalendar = "daily";
RandomizedDelaySec = "1h";
};
passwordFile = config.age.secrets.restic.path;
paths = [
2023-07-31 22:26:11 +02:00
"/var/lib/containers/storage/volumes/${volumeName}"
2023-07-12 12:28:45 +02:00
];
};
virtualisation.oci-containers = {
backend = "podman";
containers.homeassistant = {
2023-07-31 22:26:11 +02:00
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
];
};
};
}