summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonrad Malik <konrad.malik@gmail.com>2024-09-23 23:29:11 +0200
committerKonrad Malik <konrad.malik@gmail.com>2024-09-29 23:52:55 +0200
commite7062a6b066d07a358978487c2509f2b75122f90 (patch)
tree4e17d59391bf995123b3ccbae47179368dac2f42
parentfetch-yarn-deps: handle packages that are locally linked (#342186) (diff)
downloadnixpkgs-e7062a6b066d07a358978487c2509f2b75122f90.tar.gz
mise: fix shell completion
Replace 'usage' cmd in completion files with nix store path
-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 \