Update modules/server/containers/apps/homeassistant.nix
This commit is contained in:
@@ -1,3 +1,43 @@
|
|||||||
{...}:{
|
{ config, containerCfg, pkgs, lib, builder, name, ... }:
|
||||||
|
let
|
||||||
|
serverCfg = config.syscfg.server;
|
||||||
|
image = pkgs.dockerTools.streamLayeredImage {
|
||||||
|
name = pkgs.home-assistant.name;
|
||||||
|
tag = pkgs.home-assistant.version;
|
||||||
|
contents = [ ];
|
||||||
|
config = {
|
||||||
|
Entrypoint = [ "${pkgs.home-assistant}/bin/hass" ];
|
||||||
|
ExposedPorts = {
|
||||||
|
"8123/tcp" = {};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
sops = true;
|
||||||
|
db = false;
|
||||||
|
|
||||||
|
paths = [{
|
||||||
|
path = "${serverCfg.configPath}/homeassistant/";
|
||||||
|
mode = "0755";
|
||||||
|
}];
|
||||||
|
|
||||||
|
containers = {
|
||||||
|
server = builder.mkContainer {
|
||||||
|
subdomain = containerCfg.subdomain;
|
||||||
|
imageStream = image;
|
||||||
|
port = 8123;
|
||||||
|
secret = name;
|
||||||
|
extraEnv = {
|
||||||
|
TZ = config.time.timeZone or "UTC";
|
||||||
|
};
|
||||||
|
overrides = {
|
||||||
|
cmd = [ "--config" "/config" ];
|
||||||
|
volumes = [
|
||||||
|
"${serverCfg.configPath}/homeassistant/:/config"
|
||||||
|
"/run/dbus:/run/dbus:ro" # Required for Bluetooth/mDNS service discovery
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user