1 { lib, fetchFromSourcehut, rustPlatform, makeWrapper, withPulseaudio ? false, pulseaudio }:
3 rustPlatform.buildRustPackage rec {
7 src = fetchFromSourcehut {
10 rev = "swayrbar-${version}";
11 sha256 = "sha256-mMcY5TatVHSAsB1E9rcpMh4/yX7j6alZX6ed0yVHFn4=";
14 cargoHash = "sha256-fr4hzKDU1n/nSn1Sn7SoI/ZMYm7VU884Rl3Vx+aXInY=";
17 buildAndTestSubdir = pname;
19 nativeBuildInputs = [ makeWrapper ];
25 postInstall = lib.optionals withPulseaudio ''
26 wrapProgram "$out/bin/swayrbar" \
27 --prefix PATH : "$out/bin:${lib.makeBinPath [ pulseaudio ]}"
31 description = "Status command for sway's swaybar implementing the swaybar-protocol";
32 homepage = "https://git.sr.ht/~tsdh/swayr#a-idswayrbarswayrbara";
33 license = with licenses; [ gpl3Plus ];
34 platforms = platforms.linux;
35 maintainers = with maintainers; [ sebtm ];
36 mainProgram = "swayrbar";