2023-05-24 13:37:59 +00:00
|
|
|
{ lib, fetchFromSourcehut, rustPlatform, makeWrapper, withPulseaudio ? false, pulseaudio }:
|
2023-02-09 11:40:11 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "swayrbar";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.3.8";
|
2023-02-09 11:40:11 +00:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~tsdh";
|
|
|
|
repo = "swayr";
|
|
|
|
rev = "swayrbar-${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-pCXkgIesHqXI/m8ecytlq+U62lIrf7bOv95Hi/nyf/g=";
|
2023-02-09 11:40:11 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
cargoHash = "sha256-RSdNYr6l9ayn9anczeGGh2rkKt6COqj+H71d14Gb8r0=";
|
2023-02-09 11:40:11 +00:00
|
|
|
|
|
|
|
# don't build swayr
|
|
|
|
buildAndTestSubdir = pname;
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
postInstall = lib.optionals withPulseaudio ''
|
|
|
|
wrapProgram "$out/bin/swayrbar" \
|
|
|
|
--prefix PATH : "$out/bin:${lib.makeBinPath [ pulseaudio ]}"
|
|
|
|
'';
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Status command for sway's swaybar implementing the swaybar-protocol";
|
|
|
|
homepage = "https://git.sr.ht/~tsdh/swayr#a-idswayrbarswayrbara";
|
|
|
|
license = with licenses; [ gpl3Plus ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ sebtm ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "swayrbar";
|
2023-02-09 11:40:11 +00:00
|
|
|
};
|
|
|
|
}
|