packages/{ai,hategroup}_blocklist: include two versions of blocklist

This commit is contained in:
Primrose 2025-11-02 14:51:11 +08:00
parent cb1310015e
commit 2ec26ff49e
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
3 changed files with 17 additions and 6 deletions

View file

@ -28,11 +28,14 @@
blocked_names.blocked_names_file = pkgs.concatText "dnsblocklist_combined" [ blocked_names.blocked_names_file = pkgs.concatText "dnsblocklist_combined" [
# Prevent building up reliance on chatbots # Prevent building up reliance on chatbots
# Gotta preserve that thinking ability of my smoof bwain # Gotta preserve that thinking ability of my smoof bwain
pkgs.ai_blocklist "${pkgs.ai_blocklist}/share/hosts.txt"
pkgs.hategroup_blocklist "${pkgs.hategroup_blocklist}/share/hosts.txt"
(pkgs.writeText "extra_dns_blocklist" ''
# This is the fascist one, just block it because I can't tell
nixos.wiki
# Gotta purify my smoos brain for a while # Gotta purify my smoos brain for a while
(pkgs.writeText "extra_dns_blocklist" ''
instagram.com instagram.com
youtube.com youtube.com
'') '')

View file

@ -17,7 +17,11 @@ in
}; };
installPhase = '' installPhase = ''
cp noai_hosts.txt $out mkdir -p $out/share
sed -i 's/^0.0.0.0 //' $out cp noai_hosts.txt $out/share/hosts.txt
# drop domain names
cat $out/share/hosts.txt |
sed 's/^0.0.0.0 //' > $out/share/domains.txt
''; '';
} }

View file

@ -17,6 +17,10 @@ in
}; };
installPhase = '' installPhase = ''
cp blocklist.txt $out mkdir -p $out/share
cp blocklist.txt $out/share/domains.txt
cat $out/share/domains.txt |
sed 's/^\([^#].*\)$/0.0.0.0 \1/' > $out/share/hosts.txt
''; '';
} }