50 lines
1.4 KiB
Nix
50 lines
1.4 KiB
Nix
{
|
|
den,
|
|
__findFile,
|
|
modules,
|
|
...
|
|
}:
|
|
{
|
|
# Basic traefik
|
|
modules.services.provides.home-assistant = {
|
|
nixos =
|
|
{ config, pkgs, ... }:
|
|
let
|
|
homeAssistantImg = pkgs.dockerTools.pullImage {
|
|
imageName = "homeassistant/home-assistant";
|
|
imageDigest = "sha256:17441c45ba14560b4ef727ee06aac4d605cf0dc0625fc4f2e043cb2551d72749";
|
|
finalImageName = "homeassistant/home-assistant";
|
|
finalImageTag = "latest";
|
|
sha256 = "sha256-fSQ3luRSFHiWP0qDzsiZsEf/l+wYgyrdicjSayZ61yQ=";
|
|
arch = "arm64";
|
|
};
|
|
in
|
|
{
|
|
virtualisation.oci-containers.containers = {
|
|
home-assistant = {
|
|
image = "homeassistant/home-assistant";
|
|
imageFile = homeAssistantImg;
|
|
volumes = [
|
|
"/data/homeAssistant:/config"
|
|
"/run/dbus:/run/dbus:ro"
|
|
"/etc/localtime:/etc/localtime:ro"
|
|
];
|
|
ports = [ "0.0.0.0:8123:8123" ];
|
|
# networks = [ "meow" ];
|
|
};
|
|
};
|
|
networking.firewall = {
|
|
allowedTCPPorts = [
|
|
8123
|
|
];
|
|
allowedUDPPortRanges = [ ];
|
|
};
|
|
services.caddy.settings = pkgs.lib.mkIf config.services.caddy.enable {
|
|
virtualHosts."ha.home.doloro.co.uk".extraConfig = ''
|
|
reverse_proxy 127.0.0.1:8123
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
}
|