summary refs log tree commit diff
path: root/pkgs/development/tools/oh-my-posh/default.nix
diff options
context:
space:
mode:
authorMario Rodas <marsam@users.noreply.github.com>2022-09-24 18:27:00 +0000
committerMario Rodas <marsam@users.noreply.github.com>2022-09-24 18:27:00 +0000
commiteaad4f9ebb264b63da217894f91528480caf96c2 (patch)
treeea00e343751190d2bbde4faee497bfe7553ce9f8 /pkgs/development/tools/oh-my-posh/default.nix
parent3fee558a7861e41fe2f498b6394f8be4e681e615 (diff)
downloadnixpkgs-eaad4f9ebb264b63da217894f91528480caf96c2.tar
nixpkgs-eaad4f9ebb264b63da217894f91528480caf96c2.tar.gz
nixpkgs-eaad4f9ebb264b63da217894f91528480caf96c2.tar.bz2
nixpkgs-eaad4f9ebb264b63da217894f91528480caf96c2.tar.lz
nixpkgs-eaad4f9ebb264b63da217894f91528480caf96c2.tar.xz
nixpkgs-eaad4f9ebb264b63da217894f91528480caf96c2.tar.zst
nixpkgs-eaad4f9ebb264b63da217894f91528480caf96c2.zip
oh-my-posh: install completions
Diffstat (limited to 'pkgs/development/tools/oh-my-posh/default.nix')
-rw-r--r--pkgs/development/tools/oh-my-posh/default.nix8
1 files changed, 7 insertions, 1 deletions
diff --git a/pkgs/development/tools/oh-my-posh/default.nix b/pkgs/development/tools/oh-my-posh/default.nix
index fa84f5c4a6f..71fbea7253f 100644
--- a/pkgs/development/tools/oh-my-posh/default.nix
+++ b/pkgs/development/tools/oh-my-posh/default.nix
@@ -1,4 +1,4 @@
-{ lib, buildGoModule, fetchFromGitHub }:
+{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
 
 buildGoModule rec {
   pname = "oh-my-posh";
@@ -15,6 +15,8 @@ buildGoModule rec {
 
   sourceRoot = "source/src";
 
+  nativeBuildInputs = [ installShellFiles ];
+
   ldflags = [ "-s" "-w" "-X" "main.Version=${version}" ];
 
   tags = [ "netgo" "osusergo" "static_build" ];
@@ -22,6 +24,10 @@ buildGoModule rec {
   postInstall = ''
     mkdir -p $out/share/oh-my-posh
     cp -r ${src}/themes $out/share/oh-my-posh/
+    installShellCompletion --cmd oh-my-posh \
+      --bash <($out/bin/oh-my-posh completion bash) \
+      --fish <($out/bin/oh-my-posh completion fish) \
+      --zsh <($out/bin/oh-my-posh completion zsh)
   '';
 
   meta = with lib; {