2024-01-17 09:03:34 -05:00
|
|
|
{pkgs, ...}: {
|
2024-01-15 00:01:16 -05:00
|
|
|
networking.firewall.allowedTCPPorts = [53 4000];
|
|
|
|
networking.firewall.allowedUDPPorts = [53];
|
|
|
|
|
|
|
|
environment.systemPackages = [pkgs.blocky];
|
|
|
|
|
|
|
|
services.blocky = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
connectIPVersion = "v4";
|
2024-01-17 09:03:34 -05:00
|
|
|
upstreamTimeout = "5s";
|
2024-01-15 00:01:16 -05:00
|
|
|
startVerifyUpstream = false;
|
|
|
|
minTlsServeVersion = "1.2";
|
|
|
|
log = {
|
|
|
|
level = "debug";
|
|
|
|
privacy = true;
|
|
|
|
};
|
|
|
|
ports = {
|
|
|
|
dns = 53;
|
|
|
|
http = 4000;
|
|
|
|
https = 443;
|
2024-01-17 09:03:34 -05:00
|
|
|
tls = 853;
|
|
|
|
};
|
|
|
|
upstreams = {
|
|
|
|
strategy = "strict";
|
|
|
|
timeout = "30s";
|
2024-01-24 05:14:59 -05:00
|
|
|
init.strategy = "fast";
|
2024-01-17 09:03:34 -05:00
|
|
|
groups = {
|
|
|
|
default = [
|
|
|
|
"tcp+udp:127.0.0.1:5335"
|
|
|
|
"tcp-tls:dns.quad9.net"
|
|
|
|
];
|
|
|
|
};
|
2024-01-15 00:01:16 -05:00
|
|
|
};
|
|
|
|
blocking = {
|
|
|
|
loading = {
|
|
|
|
strategy = "fast";
|
|
|
|
concurrency = 8;
|
2024-01-17 09:03:34 -05:00
|
|
|
refreshPeriod = "4h";
|
2024-01-15 00:01:16 -05:00
|
|
|
};
|
|
|
|
blackLists = {
|
|
|
|
ads = [
|
|
|
|
"https://blocklistproject.github.io/Lists/ads.txt"
|
|
|
|
"https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts"
|
|
|
|
"https://adaway.org/hosts.txt"
|
|
|
|
"https://v.firebog.net/hosts/AdguardDNS.txt"
|
|
|
|
"https://v.firebog.net/hosts/Admiral.txt"
|
|
|
|
"https://raw.githubusercontent.com/anudeepND/blacklist/master/adservers.txt"
|
|
|
|
"https://s3.amazonaws.com/lists.disconnect.me/simple_ad.txt"
|
|
|
|
"https://v.firebog.net/hosts/Easylist.txt"
|
|
|
|
"https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext"
|
|
|
|
"https://raw.githubusercontent.com/FadeMind/hosts.extras/master/UncheckyAds/hosts"
|
|
|
|
"https://raw.githubusercontent.com/bigdargon/hostsVN/master/hosts"
|
|
|
|
];
|
|
|
|
tracking = [
|
|
|
|
"https://v.firebog.net/hosts/Easyprivacy.txt"
|
|
|
|
"https://v.firebog.net/hosts/Prigent-Ads.txt"
|
|
|
|
"https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.2o7Net/hosts"
|
|
|
|
"https://raw.githubusercontent.com/crazy-max/WindowsSpyBlocker/master/data/hosts/spy.txt"
|
|
|
|
"https://hostfiles.frogeye.fr/firstparty-trackers-hosts.txt"
|
|
|
|
];
|
|
|
|
malicious = [
|
|
|
|
"https://raw.githubusercontent.com/DandelionSprout/adfilt/master/Alternate%20versions%20Anti-Malware%20List/AntiMalwareHosts.txt"
|
|
|
|
"https://osint.digitalside.it/Threat-Intel/lists/latestdomains.txt"
|
|
|
|
"https://s3.amazonaws.com/lists.disconnect.me/simple_malvertising.txt"
|
|
|
|
"https://v.firebog.net/hosts/Prigent-Crypto.txt"
|
|
|
|
"https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Risk/hosts"
|
|
|
|
"https://v.firebog.net/hosts/RPiList-Phishing.txt"
|
|
|
|
"https://v.firebog.net/hosts/RPiList-Malware.txt"
|
|
|
|
];
|
|
|
|
misc = [
|
|
|
|
"https://zerodot1.gitlab.io/CoinBlockerLists/hosts_browser"
|
|
|
|
"https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-only/hosts"
|
|
|
|
];
|
2024-01-17 09:03:34 -05:00
|
|
|
catchall = [
|
|
|
|
"https://big.oisd.nl/domainswild"
|
|
|
|
];
|
2024-01-15 00:01:16 -05:00
|
|
|
};
|
2024-02-05 10:02:23 -05:00
|
|
|
whiteLists = let
|
|
|
|
customWhitelist = pkgs.writeText "misc.txt" ''
|
|
|
|
ax.phobos.apple.com.edgesuite.net
|
|
|
|
amp-api-edge.apps.apple.com
|
|
|
|
(\.|^)dscx\.akamaiedge\.net$
|
|
|
|
(\.|^)wac\.phicdn\.net$
|
|
|
|
*.flake.sh
|
2024-06-17 04:48:45 -04:00
|
|
|
*.clickhouse.com
|
2024-08-31 10:06:32 -04:00
|
|
|
*.discord.com
|
2024-02-05 10:02:23 -05:00
|
|
|
'';
|
|
|
|
in {
|
|
|
|
ads = [
|
2024-01-15 00:01:16 -05:00
|
|
|
"https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/whitelist.txt"
|
|
|
|
"https://raw.githubusercontent.com/anudeepND/whitelist/master/domains/optional-list.txt"
|
|
|
|
];
|
2024-02-05 10:02:23 -05:00
|
|
|
misc = [customWhitelist];
|
2024-01-15 00:01:16 -05:00
|
|
|
};
|
|
|
|
clientGroupsBlock = {
|
|
|
|
default = [
|
|
|
|
"ads"
|
|
|
|
"tracking"
|
|
|
|
"malicious"
|
|
|
|
"misc"
|
2024-01-17 09:03:34 -05:00
|
|
|
"catchall"
|
2024-01-15 00:01:16 -05:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
customDNS = {
|
|
|
|
customTTL = "1h";
|
2024-02-06 13:40:38 -05:00
|
|
|
mapping = let
|
|
|
|
yukiIp = "192.168.1.98";
|
|
|
|
in {
|
2024-01-15 00:01:16 -05:00
|
|
|
# infra
|
|
|
|
|
|
|
|
"truenas.internal.flake.sh" = "192.168.1.199";
|
2024-02-06 13:40:38 -05:00
|
|
|
"hass.internal.flake.sh" = "${yukiIp}";
|
|
|
|
"dashboard.internal.flake.sh" = "${yukiIp}";
|
2024-01-15 00:01:16 -05:00
|
|
|
"udm.internal.flake.sh" = "192.168.1.1";
|
|
|
|
"pve.internal.flake.sh" = "192.168.1.37";
|
|
|
|
"pbs.internal.flake.sh" = "192.168.1.38";
|
|
|
|
|
|
|
|
# media
|
|
|
|
|
2024-02-06 13:40:38 -05:00
|
|
|
"jellyfin.internal.flake.sh" = "${yukiIp}";
|
|
|
|
"jellyseerr.internal.flake.sh" = "${yukiIp}";
|
|
|
|
"sonarr.internal.flake.sh" = "${yukiIp}";
|
|
|
|
"radarr.internal.flake.sh" = "${yukiIp}";
|
|
|
|
"readarr.internal.flake.sh" = "${yukiIp}";
|
|
|
|
"lidarr.internal.flake.sh" = "${yukiIp}";
|
|
|
|
"whisparr.internal.flake.sh" = "${yukiIp}";
|
|
|
|
"bazarr.internal.flake.sh" = "${yukiIp}";
|
|
|
|
"prowlarr.internal.flake.sh" = "${yukiIp}";
|
|
|
|
"stash.internal.flake.sh" = "${yukiIp}";
|
2024-01-15 00:01:16 -05:00
|
|
|
"nextcloud.internal.flake.sh" = "192.168.1.199";
|
|
|
|
|
|
|
|
# misc
|
|
|
|
|
2024-02-06 13:40:38 -05:00
|
|
|
"wallos.internal.flake.sh" = "${yukiIp}";
|
2024-01-15 00:01:16 -05:00
|
|
|
"synology.internal.flake.sh" = "192.168.1.71";
|
2024-02-06 13:40:38 -05:00
|
|
|
"paperless.internal.flake.sh" = "${yukiIp}";
|
|
|
|
"rss.internal.flake.sh" = "${yukiIp}";
|
2024-01-15 00:01:16 -05:00
|
|
|
};
|
|
|
|
};
|
|
|
|
redis = {
|
2024-01-31 09:41:32 -05:00
|
|
|
address = "192.168.1.211:6381";
|
2024-01-15 00:01:16 -05:00
|
|
|
password = "blocky";
|
2024-01-17 09:03:34 -05:00
|
|
|
database = 0;
|
2024-01-15 00:01:16 -05:00
|
|
|
required = false;
|
|
|
|
connectionAttempts = 10;
|
|
|
|
connectionCooldown = "5s";
|
|
|
|
};
|
|
|
|
caching = {
|
|
|
|
minTime = "2h";
|
|
|
|
maxTime = "12h";
|
|
|
|
maxItemsCount = 0;
|
|
|
|
prefetching = true;
|
|
|
|
prefetchExpires = "2h";
|
|
|
|
prefetchThreshold = 5;
|
|
|
|
};
|
|
|
|
prometheus = {
|
2024-01-31 14:25:10 -05:00
|
|
|
enable = true;
|
2024-01-15 00:01:16 -05:00
|
|
|
path = "/metrics";
|
|
|
|
};
|
2024-01-17 09:03:34 -05:00
|
|
|
queryLog = {
|
|
|
|
type = "console";
|
|
|
|
};
|
2024-01-15 00:01:16 -05:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|