diff options
Diffstat (limited to 'pkgs/by-name/st/stevenblack-blocklist/package.nix')
-rw-r--r-- | pkgs/by-name/st/stevenblack-blocklist/package.nix | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/pkgs/by-name/st/stevenblack-blocklist/package.nix b/pkgs/by-name/st/stevenblack-blocklist/package.nix new file mode 100644 index 0000000000000..6f36d87421d02 --- /dev/null +++ b/pkgs/by-name/st/stevenblack-blocklist/package.nix @@ -0,0 +1,69 @@ +{ + lib, + stdenvNoCC, + fetchFromGitHub, + nix-update-script, +}: +stdenvNoCC.mkDerivation (finalAttrs: { + pname = "stevenblack-blocklist"; + version = "3.14.96"; + + src = fetchFromGitHub { + owner = "StevenBlack"; + repo = "hosts"; + rev = "refs/tags/${finalAttrs.version}"; + hash = "sha256-gv40Hfe8Lk/flQp+SPwGws4eZ0umjF1qwX0HdHF9Xe4="; + }; + + outputs = [ + # default src fallback + "out" + + # base hosts file + "ads" + + # extensions only + "fakenews" + "gambling" + "porn" + "social" + ]; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out $ads $fakenews $gambling $porn $social + + # out + find alternates -type f -not -name "hosts" -exec rm {} + + cp -r alternates $out + install -Dm644 hosts $out + + # ads + install -Dm644 hosts $ads + + # extensions + install -Dm644 alternates/fakenews-only/hosts $fakenews + install -Dm644 alternates/gambling-only/hosts $gambling + install -Dm644 alternates/porn-only/hosts $porn + install -Dm644 alternates/social-only/hosts $social + + runHook postInstall + ''; + + passthru.updateScript = nix-update-script { }; + + meta = with lib; { + description = "Unified hosts file with base extensions"; + homepage = "https://github.com/StevenBlack/hosts"; + license = licenses.mit; + maintainers = with maintainers; [ + moni + Guanran928 + frontear + ]; + }; +}) |