48 lines
1.2 KiB
Nix
48 lines
1.2 KiB
Nix
{
|
|
config,
|
|
pkgs,
|
|
...
|
|
}:
|
|
let
|
|
ver = "stable";
|
|
baseDir = "/DATA/services/hass";
|
|
usr = "hass";
|
|
# port = config.wanderllama.hass.port;
|
|
in
|
|
{
|
|
virtualisation.oci-containers.containers."hass" = {
|
|
autoStart = true;
|
|
image = "ghcr.io/home-assistant/home-assistant:${ver}";
|
|
volumes = [
|
|
"${baseDir}/config:/config"
|
|
"/run/dbus:/run/dbus:ro"
|
|
"/etc/localtime:/etc/localtime:ro"
|
|
];
|
|
ports = [ "127.0.0.1:8123:8123" ];
|
|
# ports = ["127.0.0.1:${toString config.deets.nextcloud.port}:443"];
|
|
extraOptions = [
|
|
"--privileged"
|
|
"--network=host"
|
|
];
|
|
# XXX: add CAP_NET_ADMIN/NET_RAW capabilities
|
|
devices = [
|
|
"/dev/ttyUSB0:/dev/ttyUSB0"
|
|
];
|
|
# perhaps add "capabilities = {"NET_RAW" = true;};" to `podman-<container>`
|
|
environment = {
|
|
PUID = toString config.users.users.${toString usr}.uid;
|
|
GUID = toString config.users.groups.${toString usr}.gid;
|
|
TZ = "Europe/Vienna";
|
|
};
|
|
};
|
|
users.users.${toString usr} = {
|
|
group = usr;
|
|
home = "/etc/" + usr;
|
|
createHome = false;
|
|
isSystemUser = true;
|
|
extraGroups = [ "users" ];
|
|
autoSubUidGidRange = true;
|
|
};
|
|
users.groups.${toString usr} = { };
|
|
}
|