home-assistant docker
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
{ config, lib, ... }: {
|
||||
{ config, lib, ... }: let
|
||||
|
||||
hostPort = 9003;
|
||||
|
||||
subdomain = "hass";
|
||||
|
||||
name = "home-assistant";
|
||||
|
||||
in {
|
||||
|
||||
options.sysconfig.docker.home-assistant.enable = with lib; mkOption {
|
||||
type = with types; bool;
|
||||
@@ -9,7 +17,7 @@
|
||||
|
||||
networking.firewall.interfaces = {
|
||||
"ve-traefik" = {
|
||||
allowedTCPPorts = [ 9003 ];
|
||||
allowedTCPPorts = [ hostPort ];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -19,32 +27,35 @@
|
||||
# unstable, waiting for 26.05
|
||||
#pull = "newer";
|
||||
|
||||
hostname = "hass.esotericbytes.com";
|
||||
hostname = "${subdomain}.esotericbytes.com";
|
||||
|
||||
networks = [
|
||||
"docker-main"
|
||||
];
|
||||
|
||||
labels = {
|
||||
"traefik.http.routers.home-assistant.entrypoints" = "localsecure";
|
||||
"traefik.http.routers.home-assistant.rule" = "Host(`hass.esotericbytes.com`)";
|
||||
"traefik.http.routers.home-assistant.service" = "home-assistant";
|
||||
"traefik.http.routers.home-assistant.tls.certResolver" = "cloudflare";
|
||||
"traefik.http.routers.${name}.entrypoints" = "localsecure";
|
||||
"traefik.http.routers.${name}.rule" = "Host(`${subdomain}.esotericbytes.com`)";
|
||||
"traefik.http.routers.${name}.service" = "${name}";
|
||||
"traefik.http.routers.${name}.tls.certResolver" = "cloudflare";
|
||||
|
||||
"traefik.http.services.home-assistant.loadbalancer.server.url" = "http://192.168.100.10:9003";
|
||||
"traefik.http.services.${name}.loadbalancer.server.url" = "http://192.168.100.10:${builtins.toString hostPort}";
|
||||
};
|
||||
|
||||
extraOptions = lib.mkIf config.sysconfig.docker.nvidia [
|
||||
extraOptions = [
|
||||
"--ip=192.168.101.6"
|
||||
"--TZ=America/Chicago"
|
||||
];
|
||||
|
||||
environment = {
|
||||
TZ = "America/Chicago";
|
||||
};
|
||||
|
||||
ports = [
|
||||
"9003:8123"
|
||||
"${builtins.toString hostPort}:8123"
|
||||
];
|
||||
|
||||
volumes = [
|
||||
"/etc/home-assistant/:/config/"
|
||||
"vol_home-assistant:/config/"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -16,7 +16,10 @@
|
||||
programs.virt-manager.enable = true;
|
||||
|
||||
virtualisation = {
|
||||
libvirtd.enable = true;
|
||||
libvirtd = {
|
||||
enable = true;
|
||||
qemu.swtpm.enable = true;
|
||||
};
|
||||
|
||||
spiceUSBRedirection.enable = true;
|
||||
};
|
||||
|
||||
@@ -8,5 +8,6 @@
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sysconfig.virtual-machines.home-assistant.enable {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user