mirror of
https://codeberg.org/leana8959/.files.git
synced 2026-02-01 14:29:40 +00:00
55 lines
1.3 KiB
Nix
55 lines
1.3 KiB
Nix
{
|
|
fetchFromGitHub,
|
|
fetchpatch,
|
|
stdenvNoCC,
|
|
lib,
|
|
}:
|
|
stdenvNoCC.mkDerivation (finalAttrs: {
|
|
pname = "ai_blocklist";
|
|
version = "unstable-" + lib.substring 0 8 finalAttrs.src.rev;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "laylavish";
|
|
repo = "uBlockOrigin-HUGE-AI-Blocklist";
|
|
rev = "9bb188e2701138e03f73bacebd6b19b181ca0012";
|
|
hash = "sha256-p3wfR28DH6V8BHn9DT10d09Yq3mdbBecWwlR1CdDYUA=";
|
|
};
|
|
|
|
patches =
|
|
let
|
|
mkPRPatch =
|
|
{ number, hash }:
|
|
fetchpatch {
|
|
name = "ai-blocklist-patch-PR${toString number}";
|
|
url = "https://patch-diff.githubusercontent.com/raw/laylavish/uBlockOrigin-HUGE-AI-Blocklist/pull/${toString number}.patch";
|
|
inherit hash;
|
|
};
|
|
in
|
|
map mkPRPatch [
|
|
{
|
|
number = 286;
|
|
hash = "sha256-ijkOCtHCmiSUTpVfGIumPijr8xscRDBTtu7XfTMRiXY=";
|
|
}
|
|
{
|
|
number = 300;
|
|
hash = "sha256-oso0e1+CM7hmglNZpFgaz51OU2Dhuuo7mXayTbva+vY=";
|
|
}
|
|
{
|
|
number = 324;
|
|
hash = "sha256-/FFPFZpIQSPE7XXeFEcmVv8g8wg5JFIgKoYUTthLg5A=";
|
|
}
|
|
];
|
|
|
|
# Build takes no time
|
|
preferLocalBuild = true;
|
|
allowSubstitutes = false;
|
|
|
|
installPhase = ''
|
|
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
|
|
'';
|
|
})
|