about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-03-28 18:37:42 +0200
committerGitHub <noreply@github.com>2021-03-28 18:37:42 +0200
commit6403a26e49a7bd08a0379d661bb9093387b7b95a (patch)
tree26374d7f53b660d8935282674a905d0e2a0b704a /pkgs/applications
parent7e3a726f0657aafe9f16bcada298f4863305af43 (diff)
parent414d17a17baf5316622fedafa6aa8694f1d62af8 (diff)
Merge pull request #117778 from xworld21/hugo-shell-completions
hugo: add man pages and shell completions
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/misc/hugo/default.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/applications/misc/hugo/default.nix b/pkgs/applications/misc/hugo/default.nix
index 8f3444d85d80a..bb748a1074c3c 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";