nixpkgs/pkgs/by-name/ra/radioboat/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

61 lines
1.4 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 = "Terminal web radio client";
mainProgram = "radioboat";
homepage = "https://github.com/slashformotion/radioboat";
license = licenses.asl20;
platforms = platforms.linux;
maintainers = with maintainers; [ zendo ];
};
}