From d0b037d3328752dbaf27ff1b09ac3ebe57a0b713 Mon Sep 17 00:00:00 2001 From: xrelkd <46590321+xrelkd@users.noreply.github.com> Date: Sun, 12 Feb 2023 18:56:39 +0800 Subject: [PATCH] intermodal: install shell completions --- pkgs/tools/misc/intermodal/default.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/misc/intermodal/default.nix b/pkgs/tools/misc/intermodal/default.nix index 409b603a353..555f4a529b9 100644 --- a/pkgs/tools/misc/intermodal/default.nix +++ b/pkgs/tools/misc/intermodal/default.nix @@ -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";