2019-09-02 11:57:06 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
let
|
2023-04-11 20:33:28 +00:00
|
|
|
kodi-host = "192.168.8.11";
|
|
|
|
confdir = "/var/lib/homeassistant-docker";
|
2019-09-02 11:57:06 +00:00
|
|
|
in {
|
2024-04-24 21:46:57 +00:00
|
|
|
imports = [ ./zigbee.nix ];
|
2023-04-11 20:33:28 +00:00
|
|
|
|
2024-04-24 21:46:57 +00:00
|
|
|
networking.firewall.allowedTCPPorts = [ 8123 ];
|
2023-04-11 20:33:28 +00:00
|
|
|
virtualisation.oci-containers.containers.hass = {
|
|
|
|
image = "homeassistant/home-assistant:latest";
|
|
|
|
environment = {
|
|
|
|
TZ = "Europe/Berlin";
|
|
|
|
UMASK = "007";
|
|
|
|
};
|
2024-04-24 21:46:57 +00:00
|
|
|
extraOptions = ["--net=host" "--device=/dev/zigbee" ];
|
2023-04-11 20:33:28 +00:00
|
|
|
volumes = [
|
|
|
|
"${confdir}:/config"
|
2024-04-24 21:49:22 +00:00
|
|
|
"${./zigbee-quirks}:/quirks"
|
2023-04-11 20:33:28 +00:00
|
|
|
#"${confdir}/docker-run:/etc/services.d/home-assistant/run:"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
systemd.tmpfiles.rules = [
|
|
|
|
#"f ${confdir}/docker-run 0770 kiosk kiosk - -"
|
|
|
|
# TODO:
|
2024-04-24 22:13:03 +00:00
|
|
|
"d ${confdir} 0770 root root - -"
|
2023-04-11 20:33:28 +00:00
|
|
|
];
|
|
|
|
|
2019-09-19 19:31:21 +00:00
|
|
|
services.nginx.virtualHosts."hass.shack" = {
|
|
|
|
serverAliases = [ "glados.shack" ];
|
|
|
|
locations."/" = {
|
|
|
|
proxyPass = "http://localhost:8123";
|
|
|
|
extraConfig = ''
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_set_header X-Real-IP $remote_addr;
|
2019-09-02 11:57:06 +00:00
|
|
|
|
2019-09-19 19:31:21 +00:00
|
|
|
proxy_buffering off;
|
|
|
|
'';
|
|
|
|
};
|
2019-09-02 11:57:06 +00:00
|
|
|
};
|
|
|
|
}
|