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

39 lines
1008 B
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;
in {
networking.firewall.allowedTCPPorts = [port];
services.nginx.virtualHosts."home.kmein.r" = {
locations."/" = {
proxyPass = "http://127.0.0.1:${toString port}";
};
};
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 = [
"/var/lib/containers/storage/volumes/home-assistant.bak/_data/backups"
];
};
virtualisation.oci-containers = {
backend = "podman";
containers.homeassistant = {
volumes = ["home-assistant:/config"];
environment.TZ = "Europe/Berlin";
image = "ghcr.io/home-assistant/home-assistant:stable";
extraOptions = [
"--network=host"
# "--device=/dev/ttyUSB0:/dev/ttyACM0" # Example, change this to match your own hardware
];
};
};
}