From 414d17a17baf5316622fedafa6aa8694f1d62af8 Mon Sep 17 00:00:00 2001 From: Vincenzo Mantova Date: Sat, 27 Mar 2021 11:36:37 +0000 Subject: [PATCH] hugo: add man pages and shell completions --- pkgs/applications/misc/hugo/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/misc/hugo/default.nix b/pkgs/applications/misc/hugo/default.nix index 8f3444d85d8..bb748a1074c 100644 --- a/pkgs/applications/misc/hugo/default.nix +++ b/pkgs/applications/misc/hugo/default.nix @@ -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";