feat: refactor the modules/servers directory.
This commit is contained in:
parent
4e783c052b
commit
8b754d3a7e
69 changed files with 61 additions and 62 deletions
48
modules/servers/per-server/tyr/services/home-assistant.nix
Normal file
48
modules/servers/per-server/tyr/services/home-assistant.nix
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
virtualisation.oci-containers.containers.homeassistant = {
|
||||
image = "docker.io/homeassistant/home-assistant:stable";
|
||||
autoStart = true;
|
||||
ports = [
|
||||
"8123:8123"
|
||||
];
|
||||
devices = [
|
||||
"/dev/ttyUSB0:/dev/ttyUSB0"
|
||||
];
|
||||
privileged = true;
|
||||
capabilities = {
|
||||
NET_ADMIN = true;
|
||||
NET_RAW = true;
|
||||
};
|
||||
labels = {
|
||||
"io.containers.autoupdate" = "registry";
|
||||
};
|
||||
extraOptions = ["--network=host"];
|
||||
volumes = [
|
||||
"/etc/localtime:/etc/localtime:ro"
|
||||
"/var/lib/homeassistant:/config"
|
||||
"/run/dbus:/run/dbus:ro"
|
||||
];
|
||||
};
|
||||
|
||||
services.restic.backups = {
|
||||
local.paths = ["/var/lib/homeassistant"];
|
||||
server.paths = ["/var/lib/homeassistant"];
|
||||
};
|
||||
|
||||
services.traefik.dynamicConfigOptions.http = {
|
||||
services.assistant.loadBalancer.servers = [
|
||||
{
|
||||
url = "http://localhost:8123";
|
||||
}
|
||||
];
|
||||
|
||||
routers.assistant = {
|
||||
rule = "Host(`assistant.home.cronyakatsuki.xyz`)";
|
||||
tls = {
|
||||
certResolver = "porkbun";
|
||||
};
|
||||
service = "assistant";
|
||||
entrypoints = "websecure";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue