pkl: add shell completion
This commit is contained in:
@@ -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
|
||||
'';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user