Merge pull request #117778 from xworld21/hugo-shell-completions

hugo: add man pages and shell completions
This commit is contained in:
Sandro 2021-03-28 18:37:42 +02:00 committed by GitHub
commit 6403a26e49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub }:
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "hugo";
@ -21,6 +21,17 @@ buildGoModule rec {
subPackages = [ "." ];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
$out/bin/hugo gen man
installManPage man/*
installShellCompletion --cmd hugo \
--bash <($out/bin/hugo gen autocomplete --type=bash) \
--fish <($out/bin/hugo gen autocomplete --type=fish) \
--zsh <($out/bin/hugo gen autocomplete --type=zsh)
'';
meta = with lib; {
description = "A fast and modern static website engine";
homepage = "https://gohugo.io";