Services are ready.
This commit is contained in:
@@ -3,15 +3,17 @@
|
||||
with lib;
|
||||
|
||||
let
|
||||
homeAssistantVersion = "2026.2.3";
|
||||
mqttVersion = "2.1-alpine";
|
||||
helper = import ./lib.nix { inherit config pkgs lib; };
|
||||
cfg = config.numbus.services.home-assistant;
|
||||
in
|
||||
|
||||
helper.mkPodmanService {
|
||||
name = "home-assistant";
|
||||
description = "Home Assistant, libre house control and much more";
|
||||
defaultPort = "8123";
|
||||
name = "home-assistant";
|
||||
pod = "home-assistant";
|
||||
defaultPort = "8123";
|
||||
dataDir = false;
|
||||
|
||||
extraOptions = {
|
||||
@@ -23,14 +25,11 @@ helper.mkPodmanService {
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = {
|
||||
|
||||
};
|
||||
|
||||
# Compose file good
|
||||
composeText = ''
|
||||
services:
|
||||
home-assistant:
|
||||
image: ghcr.io/home-assistant/home-assistant:latest
|
||||
image: ghcr.io/home-assistant/home-assistant:${homeAssistantVersion}
|
||||
container_name: home-assistant
|
||||
hostname: home-assistant
|
||||
networks:
|
||||
@@ -38,26 +37,35 @@ helper.mkPodmanService {
|
||||
ports:
|
||||
- "${cfg.port}:8123/tcp"
|
||||
volumes:
|
||||
- ${cfg.configDir}:/config
|
||||
- ${cfg.configDir}/config:/config
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
- /run/dbus:/run/dbus:ro
|
||||
${lib.optionalString (cfg.devices != []) ''
|
||||
devices:
|
||||
${lib.concatStringsSep "\n" (map (d: " - \"${d}\"") cfg.devices)}
|
||||
''}
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- NET_RAW
|
||||
restart: unless-stopped
|
||||
home-assistant-mqtt:
|
||||
image: docker.io/library/eclipse-mosquitto:latest
|
||||
image: docker.io/library/eclipse-mosquitto:${mqttVersion}
|
||||
container_name: home-assistant-mqtt
|
||||
hostname: home-assistant-mqtt
|
||||
user: '1000:1000'
|
||||
networks:
|
||||
home-assistant:
|
||||
volumes:
|
||||
- /mnt/config/mosquitto:/mosquitto
|
||||
- ${cfg.configDir}/mqtt:/mosquitto
|
||||
security_opt:
|
||||
- no-new-privileges:true
|
||||
cap_drop:
|
||||
- NET_RAW
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
home-assistant:
|
||||
name: home-assistant
|
||||
driver: bridge
|
||||
'';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user