add home assistant

This commit is contained in:
Joakim Repomaa
2025-03-30 20:08:59 +03:00
parent 8586351606
commit 5c5f3dd964
3 changed files with 101 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
{ config, lib, ... }:
let
cfg = config.services.home-assistant;
fqdn = "${cfg.subdomain}.${config.networking.domain}";
in
{
options.services.home-assistant = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "The subdomain to use for Home Assistant";
};
};
config = lib.mkIf cfg.enable {
services.webserver = {
enable = lib.mkDefault true;
vHosts.${fqdn}.locations."/".proxyPort = cfg.config.http.server_port;
};
};
}