mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-05-20 21:32:33 +02:00
28b7923e47
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
23 lines
727 B
Nix
23 lines
727 B
Nix
# Adguard is a network-wide ad blocker
|
|
# When installed, open localhost:3000 to setup
|
|
{config, ...}: {
|
|
services.adguardhome = {
|
|
enable = true;
|
|
port = 3000;
|
|
};
|
|
|
|
networking.firewall = {
|
|
allowedTCPPorts = [53];
|
|
allowedUDPPorts = [53];
|
|
# Allow containers to reach adguard UI (for glance dns-stats widget)
|
|
extraCommands = ''
|
|
iptables -I INPUT 1 -s 10.233.0.0/16 -p tcp --dport 3000 -j ACCEPT
|
|
'';
|
|
extraStopCommands = ''
|
|
iptables -D INPUT -s 10.233.0.0/16 -p tcp --dport 3000 -j ACCEPT 2>/dev/null || true
|
|
'';
|
|
};
|
|
|
|
services.cloudflared.tunnels."${config.var.tunnelId}".ingress."adguard.${config.var.domain}" = "http://localhost:${toString config.services.adguardhome.port}";
|
|
}
|