Unverified Commit 2e2fc891 authored by xrelkd's avatar xrelkd
Browse files

joshuto: install shell completions

parent f2da1f1e
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
{ 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";