NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.25k stars 13.52k forks source link

Spotify Adblock #209784

Open a6smile opened 1 year ago

a6smile commented 1 year ago

Project description Spotify adblocker for Linux (macOS untested) that works by wrapping getaddrinfo and cef_urlrequest_create. It blocks requests to domains that are not on the allowlist, as well as URLs that are on the denylist.

Metadata

aciceri commented 1 year ago

I'm not sure nixpkgs should include this...

By the way if someone is interested I can confirm that this works:

 spotify-adblock = pkgs.rustPlatform.buildRustPackage rec {
    pname = "spotify-adblock";
    version = "1.0.2";
    src = pkgs.fetchFromGitHub {
      owner = "abba23";
      repo = "spotify-adblock";
      rev = "v${version}";
      sha256 = "YGD3ymBZ2yT3vrcPRS9YXcljGNczJ1vCvAXz/k16r9Y=";
    };

    cargoSha256 = "bYqkCooBfGeHZHl2/9Om+0qbudyOCzpvwMhy8QCsPRE=";
  }

Then I overrode spotify adding this line here before rpath is set:

ln -s ${spotify-adblock}/lib/libspotifyadblock.so $libdir

Probably there is a cleaner way without having to retype the entire installPhase in overrideAttrs.

NL-TCH commented 1 year ago

Heya,

i created a package that auto patches the official spotify nix package with the adblock fix. (with a lot of help from @aciceri and his code).

checkout my readme for installation steps (only 3) https://github.com/NL-TCH/nur-packages