Skip to content

Commit

Permalink
spotifyd: fix errors
Browse files Browse the repository at this point in the history
- Fixes errors in configuration
- Add an overlay to use an older Rust version to build spotifyd until
  Spotifyd/spotifyd#719 is fixed.
  • Loading branch information
bnjmnt4n committed Feb 14, 2021
1 parent 3d4299c commit e4d86cb
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion home/spotify.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ in
global = {
username = "demoneaux";
device_name = "spotifyd";
use_keyring = "true";
use_keyring = true;
onevent = "${notificationsScript}";
};
};
Expand Down
1 change: 1 addition & 0 deletions pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ final: prev:
ttf-console-font = prev.callPackage ./ttf-console-font.nix { };
otf2bdf = prev.callPackage ./otf2bdf { };
qtspim = prev.qt5.callPackage ./qtspim.nix { };
spotifyd = prev.callPackage ./spotifyd.nix { };
}
49 changes: 49 additions & 0 deletions pkgs/spotifyd.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{ lib, fetchFromGitHub, rustPackages_1_45, pkg-config, openssl
, withALSA ? true, alsaLib ? null
, withPulseAudio ? false, libpulseaudio ? null
, withPortAudio ? false, portaudio ? null
, withMpris ? false
, withKeyring ? false
, dbus ? null
}:

# rust >= 1.48 causes a panic within spotifyd on music playback. as long as
# there is no upstream fix for the issue we use an older version of rust.
# Upstream issue: https://github.com/Spotifyd/spotifyd/issues/719
rustPackages_1_45.rustPlatform.buildRustPackage rec {
pname = "spotifyd";
version = "0.3.0";

src = fetchFromGitHub {
owner = "Spotifyd";
repo = "spotifyd";
rev = "v${version}";
sha256 = "055njhy9if4qpsbgbr6615xxhcx9plava1m4l323vi4dbw09wh5r";
};

cargoSha256 = "1ijrl208607abjwpr3cajcbj6sr35bk6ik778a58zf28kzdhrawc";

cargoBuildFlags = [
"--no-default-features"
"--features"
"${lib.optionalString withALSA "alsa_backend,"}${lib.optionalString withPulseAudio "pulseaudio_backend,"}${lib.optionalString withPortAudio "portaudio_backend,"}${lib.optionalString withMpris "dbus_mpris,"}${lib.optionalString withKeyring "dbus_keyring,"}"
];

nativeBuildInputs = [ pkg-config ];

buildInputs = [ openssl ]
++ lib.optional withALSA alsaLib
++ lib.optional withPulseAudio libpulseaudio
++ lib.optional withPortAudio portaudio
++ lib.optional (withMpris || withKeyring) dbus;

doCheck = false;

meta = with lib; {
description = "An open source Spotify client running as a UNIX daemon";
homepage = "https://github.com/Spotifyd/spotifyd";
license = with licenses; [ gpl3 ];
maintainers = with maintainers; [ anderslundstedt Br1ght0ne marsam ];
platforms = platforms.unix;
};
}

0 comments on commit e4d86cb

Please sign in to comment.