refactor: use list to declare filters
This commit is contained in:
@@ -1,42 +1,37 @@
|
|||||||
{lib, ...}: {
|
{
|
||||||
services.adguardhome = {
|
config,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
with lib; let
|
||||||
|
cfg = config.services.adguardhome;
|
||||||
|
in {
|
||||||
enable = true;
|
enable = true;
|
||||||
openFirewall = true;
|
openFirewall = true;
|
||||||
port = 8753;
|
port = 8753;
|
||||||
settings = {
|
settings = {
|
||||||
filters =
|
filters =
|
||||||
lib.mapAttrsToList (n: v: {
|
imap (id: url: {
|
||||||
enabled = true;
|
enabled = true;
|
||||||
id = n;
|
inherit id url;
|
||||||
name = n;
|
}) [
|
||||||
url = v;
|
"https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/pro.txt"
|
||||||
}) {
|
"https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/hoster.txt"
|
||||||
"Hagezi's Multi PRO" = "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/pro.txt";
|
"https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/doh-vpn-proxy-bypass.txt"
|
||||||
|
"https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/dyndns.txt"
|
||||||
"Hagezi's Badware Hoster" = "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/hoster.txt";
|
"https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/gambling.txt"
|
||||||
|
"https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/native.lgwebos.txt"
|
||||||
"Hagezi's DNS Bypass blocking" = "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/doh-vpn-proxy-bypass.txt";
|
"https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/hosts/native.tiktok.extended.txt"
|
||||||
|
"https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/native.winoffice.txt"
|
||||||
"Hagezi's Dynamic DNS blocking" = "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/dyndns.txt";
|
"https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/popupads.txt"
|
||||||
|
"https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/tif.txt"
|
||||||
"Hagezi's Gambling" = "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/gambling.txt";
|
];
|
||||||
|
|
||||||
"Hagezi's Native - LG webOS" = "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/native.lgwebos.txt";
|
|
||||||
|
|
||||||
"Hagezi's Native - Tiktok (Agressive)" = "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/hosts/native.tiktok.extended.txt";
|
|
||||||
|
|
||||||
"Hagezi's Native - Microsoft/Windows" = "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/native.winoffice.txt";
|
|
||||||
|
|
||||||
"Hagezi's Pop-up Ads" = "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/popupads.txt";
|
|
||||||
|
|
||||||
"Hagezi's TIF" = "https://cdn.jsdelivr.net/gh/hagezi/dns-blocklists@latest/adblock/tif.txt";
|
|
||||||
};
|
|
||||||
user_rules = [
|
user_rules = [
|
||||||
"@@||tumblr.com^$important"
|
"@@||neocities.org^$important"
|
||||||
"@@||wordpress.com^$important"
|
|
||||||
"@@||tailscale.com^$important"
|
"@@||tailscale.com^$important"
|
||||||
"@@||torproject.org^$important"
|
"@@||torproject.org^$important"
|
||||||
"@@||neocities.org^$important"
|
"@@||tumblr.com^$important"
|
||||||
|
"@@||wordpress.com^$important"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user