summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksana <me@aleksana.moe>2024-10-14 15:58:00 +0800
committerGitHub <noreply@github.com>2024-10-14 15:58:00 +0800
commite187e0f18361e9c51a71abc391210ff3dc28801e (patch)
tree55a2ba4e198dd611028af82d4dc55451182af91e
parentnushellPlugins.net: 1.7.0 -> 1.8.0 (#348346) (diff)
parentmise: fix shell completion (diff)
downloadnixpkgs-e187e0f18361e9c51a71abc391210ff3dc28801e.tar.gz
mise: fix shell completion (#344065)
-rw-r--r--pkgs/tools/misc/mise/default.nix48
1 files changed, 31 insertions, 17 deletions
diff --git a/pkgs/tools/misc/mise/default.nix b/pkgs/tools/misc/mise/default.nix
index ace598e053b7..6964083e631c 100644
--- a/pkgs/tools/misc/mise/default.nix
+++ b/pkgs/tools/misc/mise/default.nix
@@ -1,18 +1,20 @@
-{ lib
-, nix-update-script
-, rustPlatform
-, fetchFromGitHub
-, installShellFiles
-, stdenv
-, coreutils
-, bash
-, pkg-config
-, openssl
-, direnv
-, Security
-, SystemConfiguration
-, mise
-, testers
+{
+ lib,
+ nix-update-script,
+ rustPlatform,
+ fetchFromGitHub,
+ installShellFiles,
+ stdenv,
+ coreutils,
+ bash,
+ pkg-config,
+ openssl,
+ direnv,
+ Security,
+ SystemConfiguration,
+ usage,
+ mise,
+ testers,
}:
rustPlatform.buildRustPackage rec {
@@ -34,8 +36,16 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-jGqaGbue+AEK0YjhHMlm84XBgA20p8Um03TjctjXVz0=";
- nativeBuildInputs = [ installShellFiles pkg-config ];
- buildInputs = [ openssl ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Security SystemConfiguration ];
+ nativeBuildInputs = [
+ installShellFiles
+ pkg-config
+ ];
+ buildInputs =
+ [ openssl ]
+ ++ lib.optionals stdenv.hostPlatform.isDarwin [
+ Security
+ SystemConfiguration
+ ];
postPatch = ''
patchShebangs --build \
@@ -70,6 +80,10 @@ rustPlatform.buildRustPackage rec {
postInstall = ''
installManPage ./man/man1/mise.1
+ substituteInPlace ./completions/{mise.bash,mise.fish,_mise} \
+ --replace-fail '-v usage' '-v ${usage}/bin/usage' \
+ --replace-fail 'usage complete-word' '${usage}/bin/usage complete-word'
+
installShellCompletion \
--bash ./completions/mise.bash \
--fish ./completions/mise.fish \