diff --git a/nix/configurations/vanadium/nixos/connectivity.nix b/nix/configurations/vanadium/nixos/connectivity.nix index 95a7453c..2d67634d 100644 --- a/nix/configurations/vanadium/nixos/connectivity.nix +++ b/nix/configurations/vanadium/nixos/connectivity.nix @@ -165,6 +165,31 @@ lb_strategy = "p2"; lb_estimator = true; + # Prevent building up reliance on chatbots + # Gotta preserve that thinking ability of my smoof bwain + blocked_names = { + blocked_names_file = let + ai-blocklist = + pkgs.fetchFromGitHub { + owner = "laylavish"; + repo = "uBlockOrigin-HUGE-AI-Blocklist"; + rev = "f63645250fbd982b8a6ebc9b384e7dbbc37d174c"; + hash = "sha256-nuZnU+CJYdN8dR7yC8Zq13C8MgBYwZZdyQEFeSMUQkA="; + } + + "/noai_hosts.txt"; + + # Blocklists are made of one pattern per line. + # https://github.com/DNSCrypt/dnscrypt-proxy/blob/fa59f990431a49b6485f63f96601bc7e64017bf8/dnscrypt-proxy/example-dnscrypt-proxy.toml#L583C4-L583C75 + blocked_names = lib.pipe (builtins.readFile ai-blocklist) [ + (lib.replaceStrings ["\r\n"] ["\n"]) # convert to unix ending just in case + (lib.splitString "\n") + (builtins.filter (x: ! (x == "" || lib.hasPrefix "#" x))) + (builtins.map (x: builtins.elemAt (lib.splitString " " x) 1)) # remove 0.0.0.0 + ]; + in + pkgs.writeText "no-ai-blocklist" (builtins.concatStringsSep "\n" blocked_names); + }; + # Add this to test if dnscrypt-proxy is actually used to resolve DNS requests # query_log.file = "/var/log/dnscrypt-proxy/query.log"; sources.public-resolvers = {