mirror of
https://codeberg.org/leana8959/.files.git
synced 2025-12-06 06:39:14 +00:00
Compare commits
5 commits
fe642eba09
...
a135fecd68
| Author | SHA1 | Date | |
|---|---|---|---|
| a135fecd68 | |||
| 7a613e9a43 | |||
| 3eb030b8f4 | |||
| 12ccc6c619 | |||
| adf81cc4bd |
4 changed files with 56 additions and 34 deletions
|
|
@ -63,10 +63,10 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
filters = ''
|
filters = ''
|
||||||
category "Spotify" {
|
category "Spotify" {
|
||||||
params "context@open.spotify.com" "si@open.spotify.com"
|
params "context@*spotify.com" "si@*spotify.com"
|
||||||
}
|
}
|
||||||
category "YouTube" {
|
category "YouTube" {
|
||||||
params "si@youtu.be" "pp@youtu.be" "si@youtube.com" "pp@youtube.com"
|
params "si@youtu.be" "pp@youtu.be" "si@*youtube.com" "pp@*youtube.com"
|
||||||
}
|
}
|
||||||
category "WTF" {
|
category "WTF" {
|
||||||
params "utm_*"
|
params "utm_*"
|
||||||
|
|
|
||||||
|
|
@ -29,41 +29,18 @@
|
||||||
|
|
||||||
# Blocklists are made of one pattern per line.
|
# Blocklists are made of one pattern per line.
|
||||||
# https://github.com/DNSCrypt/dnscrypt-proxy/blob/fa59f990431a49b6485f63f96601bc7e64017bf8/dnscrypt-proxy/example-dnscrypt-proxy.toml#L583C4-L583C75
|
# https://github.com/DNSCrypt/dnscrypt-proxy/blob/fa59f990431a49b6485f63f96601bc7e64017bf8/dnscrypt-proxy/example-dnscrypt-proxy.toml#L583C4-L583C75
|
||||||
blocked_names.blocked_names_file = let
|
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
|
||||||
ai_list = let
|
pkgs.ai_blocklist
|
||||||
src = pkgs.fetchFromGitHub {
|
pkgs.hategroup_blocklist
|
||||||
owner = "laylavish";
|
|
||||||
repo = "uBlockOrigin-HUGE-AI-Blocklist";
|
|
||||||
rev = "9bb188e2701138e03f73bacebd6b19b181ca0012";
|
|
||||||
hash = "sha256-p3wfR28DH6V8BHn9DT10d09Yq3mdbBecWwlR1CdDYUA=";
|
|
||||||
};
|
|
||||||
in
|
|
||||||
lib.pipe (builtins.readFile "${src}/noai_hosts.txt") [
|
|
||||||
(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
|
|
||||||
];
|
|
||||||
|
|
||||||
hategroup_list = let
|
# Gotta purify my smoos brain for a while
|
||||||
src = pkgs.fetchFromGitHub {
|
(pkgs.writeText "extra_dns_blocklist" ''
|
||||||
owner = "chigh";
|
instagram.com
|
||||||
repo = "hategroup-dnsbl";
|
youtube.com
|
||||||
rev = "cc19c050997d5f54014bb20c764b131e003dfb17";
|
'')
|
||||||
hash = "sha256-SZBrjIBUw687MdrbOV7WrP5IhAAtKvPL2GqdcICHNvQ=";
|
];
|
||||||
};
|
|
||||||
in
|
|
||||||
lib.pipe (builtins.readFile "${src}/blocklist.txt") [
|
|
||||||
(lib.replaceStrings ["\r\n"] ["\n"]) # convert to unix ending just in case
|
|
||||||
(lib.splitString "\n")
|
|
||||||
(builtins.filter (x: ! (x == "" || lib.hasPrefix "#" x)))
|
|
||||||
];
|
|
||||||
|
|
||||||
combined_lists = ai_list ++ hategroup_list;
|
|
||||||
in
|
|
||||||
pkgs.writeText "dnsblocklist" (builtins.concatStringsSep "\n" combined_lists);
|
|
||||||
|
|
||||||
# Add this to test if dnscrypt-proxy is actually used to resolve DNS requests
|
# Add this to test if dnscrypt-proxy is actually used to resolve DNS requests
|
||||||
# query_log.file = "/var/log/dnscrypt-proxy/query.log";
|
# query_log.file = "/var/log/dnscrypt-proxy/query.log";
|
||||||
|
|
|
||||||
23
nix/packages/by-name/ai_blocklist/package.nix
Normal file
23
nix/packages/by-name/ai_blocklist/package.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
{
|
||||||
|
fetchFromGitHub,
|
||||||
|
stdenvNoCC,
|
||||||
|
lib,
|
||||||
|
}: let
|
||||||
|
rev = "9bb188e2701138e03f73bacebd6b19b181ca0012";
|
||||||
|
in
|
||||||
|
stdenvNoCC.mkDerivation {
|
||||||
|
pname = "ai_blocklist";
|
||||||
|
version = "unstable-" + lib.substring 0 8 rev;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "laylavish";
|
||||||
|
repo = "uBlockOrigin-HUGE-AI-Blocklist";
|
||||||
|
inherit rev;
|
||||||
|
hash = "sha256-p3wfR28DH6V8BHn9DT10d09Yq3mdbBecWwlR1CdDYUA=";
|
||||||
|
};
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
cp noai_hosts.txt $out
|
||||||
|
sed -i 's/^0.0.0.0 //' $out
|
||||||
|
'';
|
||||||
|
}
|
||||||
22
nix/packages/by-name/hategroup_blocklist/package.nix
Normal file
22
nix/packages/by-name/hategroup_blocklist/package.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
fetchFromGitHub,
|
||||||
|
stdenvNoCC,
|
||||||
|
lib,
|
||||||
|
}: let
|
||||||
|
rev = "cc19c050997d5f54014bb20c764b131e003dfb17";
|
||||||
|
in
|
||||||
|
stdenvNoCC.mkDerivation {
|
||||||
|
pname = "hategroup_blocklist";
|
||||||
|
version = "unstable-" + lib.substring 0 8 rev;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "chigh";
|
||||||
|
repo = "hategroup-dnsbl";
|
||||||
|
inherit rev;
|
||||||
|
hash = "sha256-SZBrjIBUw687MdrbOV7WrP5IhAAtKvPL2GqdcICHNvQ=";
|
||||||
|
};
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
cp blocklist.txt $out
|
||||||
|
'';
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue