Skip to content

Commit 79d7331

Browse files
committed
feat: adguard
1 parent 093a9b1 commit 79d7331

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

custom_modules/core_services.nix

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,30 @@ in
6464
enable = true;
6565
};
6666

67+
# AdGuard Home DNS ad-blocking
68+
services.adguardhome = {
69+
enable = true;
70+
mutableSettings = true;
71+
port = 3003; # Web UI port (3000 is taken by Grafana)
72+
settings = {
73+
http = {
74+
address = "127.0.0.1:3003";
75+
};
76+
dns = {
77+
bind_hosts = [ "0.0.0.0" ];
78+
port = 53;
79+
upstream_dns = [
80+
"https://dns.cloudflare.com/dns-query"
81+
"https://dns.google/dns-query"
82+
];
83+
bootstrap_dns = [
84+
"1.1.1.1"
85+
"8.8.8.8"
86+
];
87+
};
88+
};
89+
};
90+
6791
systemd.services.tailscale-optimization = {
6892
description = "Optimize ethtool settings for Tailscale";
6993
after = [ "network.target" ];
@@ -225,6 +249,10 @@ in
225249
reverse_proxy 127.0.0.1:3428
226250
}
227251
252+
handle_path /adguard* {
253+
reverse_proxy 127.0.0.1:3003
254+
}
255+
228256
handle {
229257
reverse_proxy 127.0.0.1:8082
230258
}
@@ -480,6 +508,17 @@ in
480508
description = "Login: admin / yourpassword";
481509
};
482510
}
511+
{
512+
"AdGuard Home" = {
513+
icon = "adguard-home";
514+
href = "/adguard/";
515+
description = "DNS Ad-blocking";
516+
widget = {
517+
type = "adguard";
518+
url = "http://127.0.0.1:3003";
519+
};
520+
};
521+
}
483522
];
484523
}
485524
];
@@ -628,6 +667,11 @@ in
628667
47990
629668
47989
630669
8083 # openstreetmap
670+
53 # DNS (AdGuard)
671+
];
672+
673+
networking.firewall.allowedUDPPorts = [
674+
53 # DNS (AdGuard)
631675
];
632676

633677
services.lorri.enable = true;

0 commit comments

Comments
 (0)