Fix adblock at system start

This commit is contained in:
Chris Dombroski 2024-05-11 12:53:43 -04:00
parent 8ce6f14447
commit dcbe3fb40e

View file

@ -59,14 +59,12 @@
postStop = "systemctl try-reload-or-restart unbound";
path = with pkgs; [ gawk wget ];
script = ''
wget -nv -O - https://raw.githubusercontent.com/hagezi/dns-blocklists/main/unbound/tif.blacklist.conf > /etc/unbound/new.conf
echo 'local-zone: "iogames.space." always_nxdomain' >> /etc/unbound/new.conf
echo 'local-zone: "taming.io." always_nxdomain' >> /etc/unbound/new.conf
awk '!seen[$0]++' /etc/unbound/new.conf > /etc/unbound/ads.conf
rm /etc/unbound/new.conf
wget -nv -O - https://raw.githubusercontent.com/hagezi/dns-blocklists/main/unbound/tif.blacklist.conf > /tmp/new.conf
echo 'local-zone: "iogames.space." always_nxdomain' >> /tmp/new.conf
echo 'local-zone: "taming.io." always_nxdomain' >> /tmp/new.conf
awk '!seen[$0]++' /tmp/new.conf > /etc/unbound/ads.conf
rm /tmp/new.conf
'';
wantedBy = [ "multi-user.target" ];
before = [ "unbound.service" ];
};
};
@ -85,6 +83,7 @@
"/etc/ssh/ssh_host_rsa_key.pub"
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/unbound/ads.conf"
];
};
};