From 17e90ebdb8025110ae737d1a7d87cb584ca4ae4c Mon Sep 17 00:00:00 2001 From: Spencer Whitt Date: Thu, 3 Jun 2021 20:01:25 -0400 Subject: [PATCH] handlr: install shell completions for zsh and fish --- pkgs/tools/misc/handlr/default.nix | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/misc/handlr/default.nix b/pkgs/tools/misc/handlr/default.nix index a2dfe7feafc0..e9cd89c5f2dc 100644 --- a/pkgs/tools/misc/handlr/default.nix +++ b/pkgs/tools/misc/handlr/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, rustPlatform, fetchFromGitHub, shared-mime-info, libiconv }: +{ lib, stdenv, rustPlatform, fetchFromGitHub, shared-mime-info, libiconv, installShellFiles }: rustPlatform.buildRustPackage rec { pname = "handlr"; @@ -13,13 +13,19 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "sha256-xDQV8wVlzItz0lzR1nVRPVsg7nSf/khUhevDlGgSO3g="; - nativeBuildInputs = [ shared-mime-info ]; + nativeBuildInputs = [ installShellFiles shared-mime-info ]; buildInputs = lib.optional stdenv.isDarwin libiconv; preCheck = '' export HOME=$TEMPDIR ''; + postInstall = '' + installShellCompletion \ + --zsh completions/_handlr \ + --fish completions/handlr.fish + ''; + meta = with lib; { description = "Alternative to xdg-open to manage default applications with ease"; homepage = "https://github.com/chmln/handlr";