nixos-config/pkgs/license-cli/default.nix
2022-07-21 11:28:34 +08:00

33 lines
908 B
Nix

{ stdenv, lib, fetchFromSourcehut, rustPlatform, installShellFiles, scdoc }:
rustPlatform.buildRustPackage rec {
pname = "license-cli";
version = "2.6.1";
src = fetchFromSourcehut {
owner = "~zethra";
repo = "license";
rev = version;
sha256 = "sha256-39W8Jagj656rivWlNWUr7qNeDQtaBdJYUzwYucZhr5o=";
};
cargoSha256 = "sha256-CcG71oaqukbU+PBV+izlYwP3yDUE0d4mVjQV2nWIDyg=";
nativeBuildInputs = [ installShellFiles ];
preInstall = ''
${scdoc}/bin/scdoc < doc/license.scd > license.1
'';
postInstall = ''
installShellCompletion completions/license.{bash,fish}
installShellCompletion --zsh completions/_license
installManPage ./license.1
'';
meta = with lib; {
homepage = "https://git.sr.ht/~zethra/license";
description = "Command-line tool to easily add license to your project";
license = licenses.mpl20;
mainProgram = "license";
};
}