Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spotify-adblock: init at 1.4 #119367

Closed
wants to merge 7 commits into from
Closed

spotify-adblock: init at 1.4 #119367

wants to merge 7 commits into from

Conversation

milahu
Copy link
Contributor

@milahu milahu commented Apr 13, 2021

Motivation for this change

remove ads from "spotify free"

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@SuperSandro2000 SuperSandro2000 marked this pull request as draft April 13, 2021 22:01
@milahu
Copy link
Contributor Author

milahu commented Apr 14, 2021

took a while ...

problem was the old spotify version in nixpkgs unstable (black screen bug).
tried to downgrade but that caused only more problems (glibc version mismatch)

with spotify-adblock.so, spotify seems to have a hard dependency on curl-gnutls.
with curl-openssl, it throws the fatal error libcurl-gnutls.so.4: No such file or directory

the newScope + callPackage pattern is based on chromium and ungoogled-chromium

how to get this working with spotify 1.1.55.498

# /etc/nixos/configuration.nix
{ config, pkgs, lib, stdenv, ... }:
let
  base-config = {
    allowUnfree = true; # needed for spotify, ...
  };
  spotify-pkgs = import (fetchTarball
    https://github.com/NixOS/nixpkgs/archive/caeafab22e39f1e95fc9452ff190fa7bdf342579.tar.gz # 1.1.55.498
    #https://github.com/NixOS/nixpkgs/archive/bed08131cd29a85f19716d9351940bdc34834492.tar.gz # 1.1.46.916 2021-02-08 # black screen bug
    #https://github.com/NixOS/nixpkgs/archive/2c162d49cd5b979eb66ff1653aecaeaa01690fcc.tar.gz # 1.1.26.501 2020-11-09 # glibc version mismatch
    #https://github.com/NixOS/nixpkgs/archive/fcc8660d359d2c582b0b148739a72cec476cfef5.tar.gz # 1.1.10.546 2020-03-09
  ) { config = base-config; };
in
{
  imports = [ ./hardware-configuration.nix ];
  nixpkgs.config = base-config // {
    packageOverrides = pkgs: with pkgs; {
      inherit (spotify-pkgs) spotify;
      inherit (spotify-pkgs) spotify-unwrapped; # required by spotify-adblock
    };
  };
  nixpkgs.overlays = [ ( self: super: {
    spotify-adblock = pkgs.callPackage ./extra-pkgs/spotify/spotify-adblock.nix {};
  })];
  environment.systemPackages = with pkgs; [
    spotify-adblock
  ];
}
sudo mkdir -p /etc/nixos/extra-pkgs/spotify

sudo wget -O /etc/nixos/extra-pkgs/spotify/spotify-adblock.nix \
https://raw.githubusercontent.com/milahu/nixpkgs/patch-6/pkgs/applications/audio/spotify/spotify-adblock.nix

sudo nixos-rebuild switch

spotify-adblock

Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure if nixpkgs is the right place for this.

pkgs/applications/audio/spotify/spotify-adblock.nix Outdated Show resolved Hide resolved
pkgs/applications/audio/spotify/spotify-adblock.nix Outdated Show resolved Hide resolved
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
@milahu
Copy link
Contributor Author

milahu commented Apr 15, 2021

I am not sure if nixpkgs is the right place for this.

agree ... also in arch linux, adblockers like blockify or spotify-adblock-linux are in the AUR

published to NUR as nur.repos.milahu.spotify-adblock-linux
(using the original name spotify-adblock-linux since spotify-adblock is a different tool)

Comment on lines +66 to +68
callPackage = newScope spotify;
spotify-adblock = callPackage ./spotify-adblock.nix {};

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

broken. spotify is not defined here

@milahu
Copy link
Contributor Author

milahu commented Apr 19, 2021

closing in favor of

published to NUR as nur.repos.milahu.spotify-adblock-linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants