2024-02-29 20:09:43 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pipewire
|
|
|
|
, wireplumber
|
|
|
|
, makeWrapper
|
|
|
|
}:
|
|
|
|
let
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "2.2.0";
|
2024-02-29 20:09:43 +00:00
|
|
|
in
|
|
|
|
rustPlatform.buildRustPackage {
|
|
|
|
pname = "sink-rotate";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mightyiam";
|
|
|
|
repo = "sink-rotate";
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-ZHbisG9pdctkwfD1S3kxMZhBqPw0Ni5Q9qQG4RssnSw=";
|
2024-02-29 20:09:43 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
cargoHash = "sha256-TWuyU1+F3zEcFFd8ZeZmL3IvpKLLv3zimZ2WFVYFqyo=";
|
2024-02-29 20:09:43 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/sink-rotate \
|
|
|
|
--prefix PATH : ${pipewire}/bin/pw-dump \
|
|
|
|
--prefix PATH : ${wireplumber}/bin/wpctl
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-09-19 14:19:46 +00:00
|
|
|
description = "Command that rotates the default PipeWire audio sink";
|
2024-02-29 20:09:43 +00:00
|
|
|
homepage = "https://github.com/mightyiam/sink-rotate";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ mightyiam ];
|
|
|
|
mainProgram = "sink-rotate";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|