nixos-configs/common/overlays/pkgs/spotifywm.nix

65 lines
1.3 KiB
Nix
Raw Normal View History

2023-10-18 15:06:04 -04:00
# https://github.com/NixOS/nixpkgs/blob/77b27fdb6a9ba01f60b8f5c48038938cf14b7d2f/pkgs/applications/audio/spotifywm/default.nix
{
lib,
stdenv,
fetchFromGitHub,
libX11,
makeBinaryWrapper,
spotify,
symlinkJoin,
}:
let
spotifywm = stdenv.mkDerivation {
2023-11-01 15:33:33 -04:00
pname = "spotifywm";
version = "unstable-2022-10-25";
2023-10-18 15:06:04 -04:00
src = fetchFromGitHub {
owner = "dasJ";
repo = "spotifywm";
rev = "8624f539549973c124ed18753881045968881745";
hash = "sha256-AsXqcoqUXUFxTG+G+31lm45gjP6qGohEnUSUtKypew0=";
};
buildInputs = [
libX11
];
installPhase = ''
runHook preInstall
install -Dm644 spotifywm.so $out/lib/spotifywm.so
runHook postInstall
'';
};
in
symlinkJoin {
inherit (spotifywm) name;
nativeBuildInputs = [
makeBinaryWrapper
];
paths = [
spotify
spotifywm
];
postBuild = ''
wrapProgram $out/bin/spotify \
--suffix LD_PRELOAD : "$out/lib/spotifywm.so"
ln -sf $out/bin/spotify $out/bin/spotifywm
'';
meta = {
homepage = "https://github.com/dasJ/spotifywm";
description = "Wrapper around Spotify that correctly sets class name before opening the window";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ jqueiroz the-argus ];
mainProgram = "spotify";
};
}