depot/third_party/nixpkgs/pkgs/applications/audio/radioboat/default.nix
Default email 94427deb9d Project import generated by Copybara.
GitOrigin-RevId: f91ee3065de91a3531329a674a45ddcb3467a650
2023-05-24 16:37:59 +03:00

59 lines
1.3 KiB
Nix

{ lib
, fetchFromGitHub
, buildGoModule
, mpv
, makeWrapper
, installShellFiles
, nix-update-script
, testers
, radioboat
}:
buildGoModule rec {
pname = "radioboat";
version = "0.3.0";
src = fetchFromGitHub {
owner = "slashformotion";
repo = "radioboat";
rev = "v${version}";
hash = "sha256-4k+WK2Cxu1yBWgvEW9LMD2RGfiY7XDAe0qqph82zvlI=";
};
vendorHash = "sha256-H2vo5gngXUcrem25tqz/1MhOgpNZcN+IcaQHZrGyjW8=";
ldflags = [
"-s"
"-w"
"-X github.com/slashformotion/radioboat/internal/buildinfo.Version=${version}"
];
nativeBuildInputs = [ makeWrapper installShellFiles ];
preFixup = ''
wrapProgram $out/bin/radioboat --prefix PATH ":" "${lib.makeBinPath [ mpv ]}";
'';
postInstall = ''
installShellCompletion --cmd radioboat \
--bash <($out/bin/radioboat completion bash) \
--fish <($out/bin/radioboat completion fish) \
--zsh <($out/bin/radioboat completion zsh)
'';
passthru = {
updateScript = nix-update-script { };
tests.version = testers.testVersion {
package = radioboat;
command = "radioboat version";
};
};
meta = with lib; {
description = "A terminal web radio client";
homepage = "https://github.com/slashformotion/radioboat";
license = licenses.asl20;
platforms = platforms.linux;
maintainers = with maintainers; [ zendo ];
};
}