configuration.nix/hosts/shared/blocky.nix

69 lines
1.6 KiB
Nix
Raw Normal View History

2024-10-28 23:54:19 +05:30
{ pkgs, ... }: {
2024-11-17 17:22:10 +05:30
systemd.services.blocky.unitConfig.After = [ "network-online.target" ];
2024-10-28 23:54:19 +05:30
services = {
blocky = {
enable = true;
settings = {
2024-12-01 23:15:54 +05:30
bootstrapDns = [
"tcp+udp:1.1.1.1"
"tcp+udp:1.0.0.1"
];
2024-10-28 23:54:19 +05:30
upstreams = {
groups = {
default = [
# Cloudflare
"tcp+udp:1.1.1.1"
2024-12-01 23:15:54 +05:30
"tcp+udp:1.0.0.1"
2024-10-28 23:54:19 +05:30
# Google
"tcp+udp:8.8.8.8"
"tcp+udp:8.8.4.4"
];
};
strategy = "parallel_best";
timeout = "2s";
userAgent = "Praise the DNS overlords!";
};
connectIPVersion = "v4";
customDNS = {
customTTL = "1h";
filterUnmappedTypes = true;
2024-11-17 17:22:10 +05:30
mapping = { };
2024-10-28 23:54:19 +05:30
};
blocking = {
2024-11-24 16:26:51 +05:30
loading.strategy = "fast";
2024-10-28 23:54:19 +05:30
denylists = {
ads = [
"https://raw.githubusercontent.com/blocklistproject/Lists/master/ads.txt"
];
pihole = [
"https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"
];
};
allowlists = {
pihole = [
(pkgs.writeText "allowlist.txt" ''
s.youtube.com
'')
];
};
clientGroupsBlock = {
default = [ "ads" "pihole" ];
};
};
prometheus = {
enable = true;
path = "/metrics";
};
log = {
level = "warn";
format = "json";
timestamp = true;
privacy = true;
};
};
};
};
}