From eaad4f9ebb264b63da217894f91528480caf96c2 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Sat, 24 Sep 2022 18:27:00 +0000 Subject: [PATCH] oh-my-posh: install completions --- pkgs/development/tools/oh-my-posh/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/oh-my-posh/default.nix b/pkgs/development/tools/oh-my-posh/default.nix index fa84f5c4a6fd..71fbea7253f7 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; {