diff --git a/pkgs/applications/editors/glow/default.nix b/pkgs/applications/editors/glow/default.nix index cbd63c0ffcd0..fde2bebe5e4e 100644 --- a/pkgs/applications/editors/glow/default.nix +++ b/pkgs/applications/editors/glow/default.nix @@ -1,6 +1,8 @@ { lib , buildGoModule , fetchFromGitHub +, installShellFiles +, stdenv }: buildGoModule rec { pname = "glow"; @@ -19,6 +21,14 @@ buildGoModule rec { ldflags = [ "-s" "-w" "-X=main.Version=${version}" ]; + nativeBuildInputs = [ installShellFiles ]; + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + installShellCompletion --cmd glow \ + --bash <($out/bin/glow completion bash) \ + --fish <($out/bin/glow completion fish) \ + --zsh <($out/bin/glow completion zsh) + ''; + meta = with lib; { description = "Render markdown on the CLI, with pizzazz!"; homepage = "https://github.com/charmbracelet/glow";