9 withALSA ? stdenv.hostPlatform.isLinux,
11 withJack ? stdenv.hostPlatform.isLinux,
13 withPulseAudio ? config.pulseaudio or stdenv.hostPlatform.isLinux,
15 withPortAudio ? stdenv.hostPlatform.isDarwin,
17 withMpris ? stdenv.hostPlatform.isLinux,
26 rustPackages.rustPlatform.buildRustPackage rec {
28 version = "0.3.5-unstable-2024-10-21";
30 src = fetchFromGitHub {
33 rev = "b25538f5c4dfc5b376927e7edf71c7c988492ace";
34 hash = "sha256-50eUVax3yqwncQUWgCPc0PHVUuUERQ9iORSSajPHB9c=";
37 cargoHash = "sha256-3aEBLPyf72o9gF58j9OANpcqD/IClb2alfAEKRFzatU=";
39 nativeBuildInputs = [ pkg-config ];
42 lib.optionals stdenv.hostPlatform.isLinux [ openssl ]
43 ++ lib.optional (withALSA || withJack) alsa-lib
44 ++ lib.optional withJack libjack2
45 ++ lib.optional withPulseAudio libpulseaudio
46 ++ lib.optional withPortAudio portaudio
47 # The `dbus_keying` feature works on other platforms, but only requires
49 ++ lib.optional ((withMpris || withKeyring) && stdenv.hostPlatform.isLinux) dbus;
51 buildNoDefaultFeatures = true;
53 lib.optional withALSA "alsa_backend"
54 ++ lib.optional withJack "rodiojack_backend"
55 ++ lib.optional withPulseAudio "pulseaudio_backend"
56 ++ lib.optional withPortAudio "portaudio_backend"
57 ++ lib.optional withMpris "dbus_mpris"
58 ++ lib.optional withPipe "pipe_backend"
59 ++ lib.optional withKeyring "dbus_keyring";
64 tests.version = testers.testVersion {
66 version = builtins.head (lib.splitString "-" version);
68 updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; };
72 description = "Open source Spotify client running as a UNIX daemon";
73 homepage = "https://spotifyd.rs/";
74 changelog = "https://github.com/Spotifyd/spotifyd/blob/${src.rev}/CHANGELOG.md";
75 license = lib.licenses.gpl3Plus;
76 maintainers = with lib.maintainers; [
81 platforms = lib.platforms.unix;
82 mainProgram = "spotifyd";