Arion: Add homeassistant

This commit is contained in:
GHOSCHT 2024-03-07 17:03:33 +01:00
parent 61c6788047
commit af3d70ccf0
Signed by: ghoscht
GPG key ID: 2C2C1C62A5388E82
4 changed files with 47 additions and 0 deletions

View file

@ -15,6 +15,7 @@
./passwords
./media
./dashboard
./smarthome
];
environment.systemPackages = with pkgs; [arion];

View file

@ -0,0 +1,33 @@
{pkgs, ...}: {
project.name = "smarthome";
networks.dmz = {
name = "dmz";
external = true;
};
services = {
homeassistant.service = {
image = "ghcr.io/home-assistant/home-assistant:stable";
container_name = "homeassistant";
privileged = true;
labels = {
"traefik.enable" = "true";
"traefik.http.routers.homeassistant.entrypoints" = "websecure";
"traefik.http.routers.homeassistant.rule" = "Host(`home.ghoscht.com`)";
"traefik.http.routers.homeassistant.tls" = "true";
"traefik.http.routers.homeassistant.tls.certresolver" = "letsencrypt";
"traefik.http.services.homeassistant.loadbalancer.server.port" = "8123";
};
volumes = [
"/home/ghoscht/.docker/smarthome/homeassistant_data:/config"
"/etc/localtime:/etc/localtime:ro"
"/run/dbus:/run/dbus:ro"
];
restart = "always";
networks = [
"dmz"
];
};
};
}

View file

@ -0,0 +1,6 @@
# Instead of pinning Nixpkgs, we can opt to use the one in NIX_PATH
import <nixpkgs> {
# We specify the architecture explicitly. Use a Linux remote builder when
# calling arion from other platforms.
system = "x86_64-linux";
}

View file

@ -0,0 +1,7 @@
{config, ...}: {
virtualisation.arion = {
projects.smarthome.settings = {
imports = [./arion-compose.nix];
};
};
}