mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
40 lines
1018 B
Nix
40 lines
1018 B
Nix
{config, ...}: let
|
|
port = 8123;
|
|
inherit (import ../../lib) restic;
|
|
volumeName = "home-assistant";
|
|
in {
|
|
networking.firewall.allowedTCPPorts = [port];
|
|
|
|
services.nginx.virtualHosts."home.kmein.r" = {
|
|
locations."/" = {
|
|
proxyPass = "http://127.0.0.1:${toString port}";
|
|
};
|
|
};
|
|
|
|
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
|
|
];
|
|
};
|
|
};
|
|
}
|