Skip to content

Commit

Permalink
Merge pull request #113 from sellout/fix-shell-completion
Browse files Browse the repository at this point in the history
Enable shell completion of `ucm`
  • Loading branch information
ceedubs authored Feb 18, 2025
2 parents 8b7de0c + 40dae90 commit 8a0e825
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions nix/ucm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
inherit (srcArgs) sha256;
};

unison = "$out/unison/unison";
ucm = "$out/bin/ucm";
in
stdenv.mkDerivation rec {
Expand All @@ -94,23 +95,27 @@ in
binPath = lib.makeBinPath buildInputs;

installPhase = ''
runHook preInstall
mkdir -p $out/{bin,lib}
mv runtime $out/lib/runtime
mv unison $out/unison
mv ui $out/ui
makeWrapper $out/unison/unison ${ucm} \
makeWrapper ${unison} ${ucm} \
--prefix PATH : ${binPath} \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [libb2 openssl curl]} \
--add-flags "--runtime-path $out/lib/runtime/bin/unison-runtime" \
--set-default UCM_WEB_UI "$out/ui"
runHook postInstall
'';

postInstall = ''
installShellCompletion --cmd ucm \
--bash <(${ucm} --bash-completion-script ${ucm}) \
--fish <(${ucm} --fish-completion-script ${ucm}) \
--zsh <(${ucm} --zsh-completion-script ${ucm})
--bash <(${unison} --bash-completion-script ${unison}) \
--fish <(${unison} --fish-completion-script ${unison}) \
--zsh <(${unison} --zsh-completion-script ${unison})
'';

installCheckPhase = ''
Expand Down

0 comments on commit 8a0e825

Please sign in to comment.