Services: add adguard

This commit is contained in:
Toast 2024-11-05 10:42:47 +01:00
parent e15aa9ba44
commit e531e6cb68
2 changed files with 41 additions and 0 deletions

40
roles/server/adguard.nix Normal file
View file

@ -0,0 +1,40 @@
{lib, ...}: let
domain = "adguard.everest.tailscale";
port = 3001;
in {
services = {
adguardhome = {
enable = true;
host = "127.0.0.1";
port = port;
settings = {
dns = {
bind_hosts = [
"192.168.0.160"
"100.100.0.1"
];
bootstrap_dns = ["9.9.9.9"];
};
};
};
headscale.settings.dns_config = {
nameservers = lib.mkForce ["100.100.0.1"];
extra_records = [
{
name = domain;
type = "A";
value = "100.100.0.1";
}
];
};
caddy.virtualHosts.adguardhome = {
hostName = domain;
extraConfig = ''
import tailscale
reverse_proxy 127.0.0.1:${builtins.toString port}
'';
};
};
}

View file

@ -15,5 +15,6 @@
./caddy.nix
./rust_motd.nix
./minecraft.nix
./adguard.nix
];
}