Files
nixos/pkgs/adblock_update.nix
Greg Hellings c3e3ca84a2
buildbot/nix-eval Build done.
buildbot/nix-build Build done.
buildbot/nix-effects Build done.
chore: cleanup unused packages on Darwin
2026-04-29 13:02:12 -05:00

22 lines
654 B
Nix

{
writeShellApplication,
curl,
gnused,
}:
writeShellApplication {
name = "adblock-update";
runtimeInputs = [
curl
gnused
];
text = ''
curl -s https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts | sed '1,33d' > /etc/adblock_hosts
curl -s https://adaway.org/hosts.txt | sed '1,24d' | sed 's/127.0.0.1/0.0.0.0/' >> /etc/adblock_hosts
# Custom domains that I need to preserve for some reason
for f in "segment.com" "segment.io" "branch.io" "dev.visualwebsiteoptimizer.com" "click.discord.com"; do
sed -i -e "/''${f}/d" /etc/adblock_hosts # Blocks Trelly content for house investors
done
'';
}