2023-07-12 12:28:45 +02:00
|
|
|
{config, ...}: let
|
2022-03-13 17:24:59 +01:00
|
|
|
port = 8123;
|
2023-07-12 12:28:45 +02:00
|
|
|
inherit (import ../../lib) restic;
|
2022-03-13 17:24:59 +01:00
|
|
|
in {
|
|
|
|
|
networking.firewall.allowedTCPPorts = [port];
|
|
|
|
|
|
|
|
|
|
services.nginx.virtualHosts."home.kmein.r" = {
|
|
|
|
|
locations."/" = {
|
|
|
|
|
proxyPass = "http://127.0.0.1:${toString port}";
|
|
|
|
|
};
|
|
|
|
|
};
|
2022-03-10 22:59:43 +01:00
|
|
|
|
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"
|
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
2022-03-10 22:59:43 +01:00
|
|
|
virtualisation.oci-containers = {
|
|
|
|
|
backend = "podman";
|
|
|
|
|
containers.homeassistant = {
|
2023-07-22 23:43:34 +02:00
|
|
|
volumes = ["home-assistant.bak:/config"];
|
2022-03-10 22:59:43 +01:00
|
|
|
environment.TZ = "Europe/Berlin";
|
|
|
|
|
image = "ghcr.io/home-assistant/home-assistant:stable";
|
|
|
|
|
extraOptions = [
|
|
|
|
|
"--network=host"
|
2023-07-22 23:43:34 +02:00
|
|
|
"--device=/dev/ttyACM0:/dev/ttyACM0" # Example, change this to match your own hardware
|
2022-03-10 22:59:43 +01:00
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|