joshuto: install shell completions

This commit is contained in:
xrelkd 2023-08-30 10:44:20 +08:00
parent f2da1f1e64
commit 2e2fc89148
No known key found for this signature in database
GPG Key ID: BAB7A457C1D1D6B3

View File

@ -1,4 +1,10 @@
{ lib, rustPlatform, fetchFromGitHub, stdenv, darwin }:
{ lib
, rustPlatform
, fetchFromGitHub
, installShellFiles
, stdenv
, darwin
}:
rustPlatform.buildRustPackage rec {
pname = "joshuto";
@ -13,10 +19,19 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-gMX8hvt20V4XUd0nnXGA4fyOUfB7ZY1eeme9HgYopL0=";
nativeBuildInputs = [ installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin [
darwin.apple_sdk.frameworks.Foundation
];
postInstall = ''
installShellCompletion --cmd joshuto \
--bash <($out/bin/joshuto completions bash) \
--zsh <($out/bin/joshuto completions zsh) \
--fish <($out/bin/joshuto completions fish)
'';
meta = with lib; {
description = "Ranger-like terminal file manager written in Rust";
homepage = "https://github.com/kamiyaa/joshuto";