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,
25 rustPackages.rustPlatform.buildRustPackage rec {
27 version = "0.3.5-unstable-2024-09-05";
29 src = fetchFromGitHub {
32 rev = "e280d84124d854af3c2f9509ba496b1c2ba6a1ae";
33 hash = "sha256-RFfM/5DY7IG0E79zc8IuXpSNAIjloMWI3ZVbyLxh4O8=";
36 cargoHash = "sha256-z3zcQD2v71FZg6nEvKfaMiQU/aRAPFNt69b9Rm+jpuY=";
38 nativeBuildInputs = [ pkg-config ];
41 lib.optionals stdenv.hostPlatform.isLinux [ openssl ]
42 ++ lib.optional (withALSA || withJack) alsa-lib
43 ++ lib.optional withJack libjack2
44 ++ lib.optional withPulseAudio libpulseaudio
45 ++ lib.optional withPortAudio portaudio
46 # The `dbus_keying` feature works on other platforms, but only requires
48 ++ lib.optional ((withMpris || withKeyring) && stdenv.hostPlatform.isLinux) dbus;
50 buildNoDefaultFeatures = true;
52 lib.optional withALSA "alsa_backend"
53 ++ lib.optional withJack "rodiojack_backend"
54 ++ lib.optional withPulseAudio "pulseaudio_backend"
55 ++ lib.optional withPortAudio "portaudio_backend"
56 ++ lib.optional withMpris "dbus_mpris"
57 ++ lib.optional withKeyring "dbus_keyring";
62 tests.version = testers.testVersion {
64 version = builtins.head (lib.splitString "-" version);
66 updateScript = nix-update-script { extraArgs = [ "--version=branch" ]; };
70 description = "Open source Spotify client running as a UNIX daemon";
71 homepage = "https://spotifyd.rs/";
72 changelog = "https://github.com/Spotifyd/spotifyd/blob/${src.rev}/CHANGELOG.md";
73 license = lib.licenses.gpl3Plus;
74 maintainers = with lib.maintainers; [
79 platforms = lib.platforms.unix;
80 mainProgram = "spotifyd";