next step
This commit is contained in:
51
system/virtualization/docker/home-assistant/default.nix
Normal file
51
system/virtualization/docker/home-assistant/default.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{ config, lib, ... }: {
|
||||
|
||||
options.sysconfig.docker.home-assistant.enable = with lib; mkOption {
|
||||
type = with types; bool;
|
||||
default = false;
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.sysconfig.docker.home-assistant.enable && config.sysconfig.docker.enable) {
|
||||
|
||||
networking.firewall.interfaces = {
|
||||
"ve-traefik" = {
|
||||
allowedTCPPorts = [ 9003 ];
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.oci-containers.containers.home-assistant = {
|
||||
image = "home-assistant/home-assistant:stable";
|
||||
|
||||
# unstable, waiting for 26.05
|
||||
#pull = "newer";
|
||||
|
||||
hostname = "hass.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.services.home-assistant.loadbalancer.server.url" = "http://192.168.100.10:9003";
|
||||
};
|
||||
|
||||
extraOptions = lib.mkIf config.sysconfig.docker.nvidia [
|
||||
"--ip=192.168.101.6"
|
||||
"--TZ=America/Chicago"
|
||||
];
|
||||
|
||||
ports = [
|
||||
"9003:8123"
|
||||
];
|
||||
|
||||
volumes = [
|
||||
"/etc/home-assistant/:/config/"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user