add adguardhome

This commit is contained in:
Joakim Repomaa
2025-02-15 16:50:47 +02:00
parent c15d518e4a
commit 75186e2f19
7 changed files with 113 additions and 6 deletions

View File

@@ -25,9 +25,17 @@ let
locations = lib.mkOption {
type = lib.types.attrsOf types.location;
};
tailscaleAuth = lib.mkOption {
type = lib.types.bool;
default = false;
};
};
};
};
tailscaleAuthVhosts = lib.attrNames (
lib.filterAttrs (name: { tailscaleAuth, ... }: tailscaleAuth) cfg.vHosts
);
in
{
options.services.webserver = {
@@ -56,8 +64,13 @@ in
recommendedZstdSettings = true;
recommendedOptimisation = true;
tailscaleAuth = {
enable = (lib.length tailscaleAuthVhosts) > 0;
virtualHosts = tailscaleAuthVhosts;
};
virtualHosts = lib.mapAttrs
(_: { proxyBuffering, locations }: {
(_: { proxyBuffering, locations, ... }: {
forceSSL = true;
enableACME = true;
http2 = true;