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 ''; }