depot/third_party/nixpkgs/pkgs/tools/wayland/swayrbar/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

38 lines
1 KiB
Nix

{ lib, fetchFromSourcehut, rustPlatform, makeWrapper, withPulseaudio ? false, pulseaudio }:
rustPlatform.buildRustPackage rec {
pname = "swayrbar";
version = "0.3.7";
src = fetchFromSourcehut {
owner = "~tsdh";
repo = "swayr";
rev = "swayrbar-${version}";
sha256 = "sha256-41zlVT060Fu90N4oiZ6lWSZdJJSZjyk3GEA/u+bVNCI=";
};
cargoHash = "sha256-/MUolnEdYlBTfmUB/j9vHaVpU63upeMoScjHl38cGjo=";
# don't build swayr
buildAndTestSubdir = pname;
nativeBuildInputs = [ makeWrapper ];
preCheck = ''
export HOME=$TMPDIR
'';
postInstall = lib.optionals withPulseaudio ''
wrapProgram "$out/bin/swayrbar" \
--prefix PATH : "$out/bin:${lib.makeBinPath [ pulseaudio ]}"
'';
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 ];
mainProgram = "swayrbar";
};
}