pkl: add shell completion

This commit is contained in:
ryota2357
2025-12-25 16:05:09 +09:00
parent 6a81c8cfb0
commit 1817cd5d1b
+9
View File
@@ -8,6 +8,7 @@
nix-update-script,
replaceVars,
makeWrapper,
installShellFiles,
}:
let
jdk = temurin-bin-21;
@@ -43,6 +44,7 @@ stdenv.mkDerivation (finalAttrs: {
jdk
kotlinOverlay
makeWrapper
installShellFiles
];
mitmCache = gradle.fetchDeps {
@@ -81,6 +83,13 @@ stdenv.mkDerivation (finalAttrs: {
makeWrapper ${lib.getExe jdk} $out/bin/pkl --add-flags "-jar $out/opt/pkl/jpkl.jar"
${lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd pkl \
--bash <($out/bin/pkl shell-completion bash) \
--zsh <($out/bin/pkl shell-completion zsh) \
--fish <($out/bin/pkl shell-completion fish)
''}
runHook postInstall
'';