mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 04:19:19 -08:00
feat(hakurei): cloudflared
This commit is contained in:
parent
ddcdcb0e0e
commit
7ded53ccc1
10 changed files with 258 additions and 15 deletions
22
nixos/access/home-assistant.nix
Normal file
22
nixos/access/home-assistant.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib.modules) mkIf mkDefault;
|
||||
inherit (config.services) home-assistant tailscale;
|
||||
proxyPass = "http://localhost:${toString home-assistant.config.http.server_port}/";
|
||||
in {
|
||||
services.nginx.virtualHosts."home.local.${config.networking.domain}" = mkIf home-assistant.enable {
|
||||
local.enable = mkDefault true;
|
||||
locations."/" = {
|
||||
inherit proxyPass;
|
||||
};
|
||||
};
|
||||
services.nginx.virtualHosts."home.tail.${config.networking.domain}" = mkIf (home-assistant.enable && tailscale.enable) {
|
||||
local.enable = mkDefault true;
|
||||
locations."/" = {
|
||||
inherit proxyPass;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue