2024-09-09 00:22:14 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2024-09-13 01:50:53 +00:00
|
|
|
with lib; let
|
2024-10-06 15:16:52 +00:00
|
|
|
cfg = config.custom.containers.homeassistant;
|
2024-09-13 01:50:53 +00:00
|
|
|
in {
|
2024-10-06 15:16:52 +00:00
|
|
|
options.custom.containers.homeassistant.enable = mkOption {default = false;};
|
2024-09-09 00:22:14 +00:00
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
#?? arion-homeassistant pull
|
|
|
|
environment.shellAliases.arion-homeassistant = "sudo arion --prebuilt-file ${config.virtualisation.arion.projects.homeassistant.settings.out.dockerComposeYaml}";
|
|
|
|
|
2024-10-08 23:23:50 +00:00
|
|
|
virtualisation.arion.projects.homeassistant.settings.services = {
|
|
|
|
homeassistant.service = {
|
|
|
|
container_name = "homeassistant";
|
|
|
|
image = "homeassistant/home-assistant:2024.9.1";
|
|
|
|
ports = ["8123:8123"];
|
|
|
|
restart = "unless-stopped";
|
|
|
|
volumes = ["${config.custom.containers.directory}/homeassistant/config:/config"];
|
2024-09-09 00:22:14 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|