Merge pull request #223415 from caarlos0/nfpm-cmp-man

nfpm: add man and completions
This commit is contained in:
Mario Rodas 2023-03-29 07:32:24 -05:00 committed by GitHub
commit 25c7ebab8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,10 @@
{ lib, buildGoModule, fetchFromGitHub }:
{ stdenv
, lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
, buildPackages
}:
buildGoModule rec {
pname = "nfpm";
@ -15,6 +21,19 @@ buildGoModule rec {
ldflags = [ "-s" "-w" "-X main.version=${version}" ];
nativeBuildInputs = [ installShellFiles ];
postInstall =
let emulator = stdenv.hostPlatform.emulator buildPackages;
in ''
${emulator} $out/bin/nfpm man > nfpm.1
installManPage ./nfpm.1
installShellCompletion --cmd nfpm \
--bash <(${emulator} $out/bin/nfpm completion bash) \
--fish <(${emulator} $out/bin/nfpm completion fish) \
--zsh <(${emulator} $out/bin/nfpm completion zsh)
'';
meta = with lib; {
description = "A simple deb and rpm packager written in Go";
homepage = "https://github.com/goreleaser/nfpm";