Files
Olympus/system-config/services/containers/homeassistant/default.nix

29 lines
1013 B
Nix

{ config, lib, ... }: {
options.sysconfig.opts.virtualization.homeassistant.enable = lib.mkOption {
type = lib.types.bool;
default = false;
};
config = lib.mkIf config.sysconfig.opts.virtualization.homeassistant.enable {
virtualisation.oci-containers = {
backend = "docker";
containers.homeassistant = {
autoStart = true;
ports = [ "8123:8123" ];
volumes = [
"/ssd1/Home-Assistant/data:/config"
"/run/dbus:/run/dbus:ro"
];
environment.TZ = "America/Chicago";
image = "ghcr.io/home-assistant/home-assistant:stable"; # Warning: if the tag does not change, the image will not be updated
extraOptions = [
"--network=host"
#"--device=/dev/ttyACM0:/dev/ttyACM0" # Use this for external devices e.g. zigbee
];
};
};
};
}