intermodal: install shell completions

This commit is contained in:
xrelkd 2023-02-12 18:56:39 +08:00
parent c939301d72
commit d0b037d332
No known key found for this signature in database
GPG key ID: BAB7A457C1D1D6B3

View file

@ -1,4 +1,4 @@
{ lib, stdenv, rustPlatform, fetchFromGitHub }:
{ lib, stdenv, rustPlatform, fetchFromGitHub, installShellFiles }:
rustPlatform.buildRustPackage rec {
pname = "intermodal";
@ -8,14 +8,23 @@ rustPlatform.buildRustPackage rec {
owner = "casey";
repo = pname;
rev = "v${version}";
sha256 = "0mn0wm3bihn7ffqk0p79mb1hik54dbhc9diq1wh9ylpld2iqmz68";
hash = "sha256-yPyKo2j0Up8gDzi2xOBqpMwIw6rpXDCxc8fCuEblwFY=";
};
cargoSha256 = "1bvs23rb25qdwbrygzq11p8cvck5lxjp9llvs1cjdh0qzr65jwla";
cargoHash = "sha256-inJZTP4YwCZZ0JvSdGWnZbLN0A0B/+fz4g0XsfIQeq8=";
# include_hidden test tries to use `chflags` on darwin
checkFlagsArray = lib.optionals stdenv.isDarwin [ "--skip=subcommand::torrent::create::tests::include_hidden" ];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --cmd imdl \
--bash <($out/bin/imdl completions bash) \
--fish <($out/bin/imdl completions fish) \
--zsh <($out/bin/imdl completions zsh)
'';
meta = with lib; {
description = "User-friendly and featureful command-line BitTorrent metainfo utility";
homepage = "https://github.com/casey/intermodal";