From 5610d2ec67a4b54bfdf722cb3a2afd8342ee56fe Mon Sep 17 00:00:00 2001 From: Sebastian Sellmeier Date: Tue, 16 May 2023 10:52:13 +0200 Subject: [PATCH] swayrbar: Fix pulseaudio as optional dependency (default: disabled) --- pkgs/tools/wayland/swayrbar/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/wayland/swayrbar/default.nix b/pkgs/tools/wayland/swayrbar/default.nix index 72f2d8b93be3..79cc1635a9cd 100644 --- a/pkgs/tools/wayland/swayrbar/default.nix +++ b/pkgs/tools/wayland/swayrbar/default.nix @@ -1,4 +1,4 @@ -{ lib, fetchFromSourcehut, rustPlatform }: +{ lib, fetchFromSourcehut, rustPlatform, makeWrapper, withPulseaudio ? false, pulseaudio }: rustPlatform.buildRustPackage rec { pname = "swayrbar"; @@ -16,10 +16,17 @@ rustPlatform.buildRustPackage rec { # 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";