From 4395dc9f08a3e4e27d2f12d0af4bf372790d1971 Mon Sep 17 00:00:00 2001 From: tdpeuter Date: Sun, 8 Oct 2023 22:13:53 +0200 Subject: [PATCH] Test spotify-adblock --- nixos/flake.nix | 4 ++++ nixos/overlays/spotify/default.nix | 38 ++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 nixos/overlays/spotify/default.nix diff --git a/nixos/flake.nix b/nixos/flake.nix index 31056f8..34e699a 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -47,6 +47,10 @@ (import ./overlays/cmdtime) ]; + sharedOverlays = [ + (import ./overlays/spotify) + ]; + hostDefaults = { inherit system; diff --git a/nixos/overlays/spotify/default.nix b/nixos/overlays/spotify/default.nix new file mode 100644 index 0000000..a5f9c17 --- /dev/null +++ b/nixos/overlays/spotify/default.nix @@ -0,0 +1,38 @@ +final: prev: { + spotify-adblock = final.rustPlatform.buildRustPackage rec { + name = "spotify-adblock"; + version = "v1.0.3"; + src = final.fetchFromGitHub { + owner = "abba23"; + repo = "spotify-adblock"; + rev = "5a3281d"; + sha256 = "sha256-UzpHAHpQx2MlmBNKm2turjeVmgp5zXKWm3nZbEo0mYE="; + }; + + cargoHash = "sha256-oHfk68mAIcmOenW7jn71Xpt8hWVDtxyInWhVN2rH+kk="; + + buildInputs = with final; [ + cargo + rustc + ]; + }; +# spotify-wrapper = final.writeScriptBin "spotify-with-adblock" '' +# #!/bin/sh +# LD_PRELOAD=/usr/local/lib/spotify-adblock.so spotify +# ''; +# spotify = prev.spotify.overrideAttrs (something: rec { +# installPhase = '' +# echo no +# ''; + +# desktopItem = something.desktopItem.override (desktop: { +# exec = "LD_PRELOAD=/usr/local/lib/spotify-adblock.so ${desktop.exec}"; +# }); +# +# installPhase = builtins.replaceString [ +# "${something.desktopItem}" +# ] [ +# "${desktopItem}" +# ] something.installPhase; +# }); +}