{ pkgs }:
pkgs.stdenv.mkDerivation rec {
  pname = "polybar-spotify";
  version = "5edc2e598cf0ec5c54860c28db870af998271666";

  src = pkgs.fetchFromGitHub {
    owner = "Jvanrhijn";
    repo = pname;
    rev = version;
    sha256 = "sha256-JPoigtxBYnFqi+8erhTcJlGN53VtS6z9mqNajQM0Xsk=";
  };

  propagatedBuildInputs = [
    (pkgs.python39.withPackages (pyPkgs: [ pyPkgs.dbus-python ]))
    pkgs.playerctl
  ];

  installPhase = "install -Dm755 ./spotify_status.py $out/bin/polybar-spotify";
}
