From 2ec26ff49e547b4ed132137aa3a0127d981cb0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Sun, 2 Nov 2025 14:51:11 +0800 Subject: [PATCH] packages/{ai,hategroup}_blocklist: include two versions of blocklist --- nix/nixosModules/extra/secure_dns.nix | 9 ++++++--- nix/packages/by-name/ai_blocklist/package.nix | 8 ++++++-- nix/packages/by-name/hategroup_blocklist/package.nix | 6 +++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/nix/nixosModules/extra/secure_dns.nix b/nix/nixosModules/extra/secure_dns.nix index f662db89..439090b4 100644 --- a/nix/nixosModules/extra/secure_dns.nix +++ b/nix/nixosModules/extra/secure_dns.nix @@ -28,11 +28,14 @@ blocked_names.blocked_names_file = pkgs.concatText "dnsblocklist_combined" [ # Prevent building up reliance on chatbots # Gotta preserve that thinking ability of my smoof bwain - pkgs.ai_blocklist - pkgs.hategroup_blocklist + "${pkgs.ai_blocklist}/share/hosts.txt" + "${pkgs.hategroup_blocklist}/share/hosts.txt" - # Gotta purify my smoos brain for a while (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 instagram.com youtube.com '') diff --git a/nix/packages/by-name/ai_blocklist/package.nix b/nix/packages/by-name/ai_blocklist/package.nix index dc8967a8..0a683cbf 100644 --- a/nix/packages/by-name/ai_blocklist/package.nix +++ b/nix/packages/by-name/ai_blocklist/package.nix @@ -17,7 +17,11 @@ in }; installPhase = '' - cp noai_hosts.txt $out - sed -i 's/^0.0.0.0 //' $out + mkdir -p $out/share + 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 ''; } diff --git a/nix/packages/by-name/hategroup_blocklist/package.nix b/nix/packages/by-name/hategroup_blocklist/package.nix index 09d1b687..9f320335 100644 --- a/nix/packages/by-name/hategroup_blocklist/package.nix +++ b/nix/packages/by-name/hategroup_blocklist/package.nix @@ -17,6 +17,10 @@ in }; 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 ''; }