ytdl-web/nix/package.nix

41 lines
910 B
Nix
Raw Normal View History

{ buildGoModule
, installShellFiles
, lib
, rev
, version
, ...
}:
buildGoModule rec {
pname = "ytdl-web";
inherit version;
src = ./..;
vendorHash = "sha256-Rqh5tGcSey53e0Ln3u5agvOwRJ6/I1eUpzRylwtjhQo=";
ldflags = [
"-s"
"-w"
"-X $VERSION_PKG.Version=${version}"
"-X $VERSION_PKG.Build=${rev}"
"-X $VERSION_PKG.BuildDate=1970-01-01T0:00:00+0000"
"-X $VERSION_PKG.BuiltBy=nix"
];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd ${pname} \
--zsh <($out/bin/${pname} completion zsh) \
--bash <($out/bin/${pname} completion bash) \
--fish <($out/bin/${pname} completion fish)
'';
meta = with lib; {
description = "Yet another yt-dlp web frontend written in Go.";
homepage = "https://git.fifitido.net/apps/ytdl-web";
license = licenses.gpl3Only;
mainProgram = "ytdl-web";
};
}