base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / sw / swayrbar / package.nix
blobcaf81c055bb642f99e879dc65ee372d79df4d4b3
1 { lib, fetchFromSourcehut, rustPlatform, makeWrapper, withPulseaudio ? false, pulseaudio }:
3 rustPlatform.buildRustPackage rec {
4   pname = "swayrbar";
5   version = "0.4.0";
7   src = fetchFromSourcehut {
8     owner = "~tsdh";
9     repo = "swayr";
10     rev = "swayrbar-${version}";
11     sha256 = "sha256-mMcY5TatVHSAsB1E9rcpMh4/yX7j6alZX6ed0yVHFn4=";
12   };
14   cargoHash = "sha256-fr4hzKDU1n/nSn1Sn7SoI/ZMYm7VU884Rl3Vx+aXInY=";
16   # don't build swayr
17   buildAndTestSubdir = pname;
19   nativeBuildInputs = [ makeWrapper ];
21   preCheck = ''
22     export HOME=$TMPDIR
23   '';
25   postInstall = lib.optionals withPulseaudio ''
26     wrapProgram "$out/bin/swayrbar" \
27       --prefix PATH : "$out/bin:${lib.makeBinPath [ pulseaudio ]}"
28   '';
30   meta = with lib; {
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";
37   };