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

55 lines
1.2 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,
spotifywm-src,
2023-10-18 15:06:04 -04:00
libX11,
makeBinaryWrapper,
spotify,
symlinkJoin,
...
2023-11-22 15:33:16 -05:00
}: let
2023-10-18 15:06:04 -04:00
spotifywm = stdenv.mkDerivation {
2023-11-01 15:33:33 -04:00
pname = "spotifywm";
version = spotifywm-src.rev;
2023-10-18 15:06:04 -04:00
src = spotifywm-src;
2023-10-18 15:06:04 -04:00
buildInputs = [libX11];
2023-10-18 15:06:04 -04:00
installPhase = ''
runHook preInstall
install -Dm644 spotifywm.so $out/lib/spotifywm.so
runHook postInstall
'';
};
in
2023-11-22 15:33:16 -05:00
symlinkJoin {
inherit (spotifywm) name;
2023-10-18 15:06:04 -04:00
nativeBuildInputs = [makeBinaryWrapper];
2023-10-18 15:06:04 -04:00
2023-11-22 15:33:16 -05:00
paths = [
spotify
spotifywm
];
2023-10-18 15:06:04 -04:00
2023-11-22 15:33:16 -05:00
postBuild = ''
wrapProgram $out/bin/spotify \
--suffix LD_PRELOAD : "$out/lib/spotifywm.so"
2023-10-18 15:06:04 -04:00
2023-11-22 15:33:16 -05:00
ln -sf $out/bin/spotify $out/bin/spotifywm
'';
2023-10-18 15:06:04 -04:00
2023-11-22 15:33:16 -05:00
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";
};
}