add home assistant
This commit is contained in:
20
modules/services/home-assistant.nix
Normal file
20
modules/services/home-assistant.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user