nixpkgs/pkgs/tools/misc/handlr/default.nix

36 lines
946 B
Nix
Raw Normal View History

{ lib, stdenv, rustPlatform, fetchFromGitHub, shared-mime-info, libiconv, installShellFiles }:
2021-03-18 21:03:55 +00:00
rustPlatform.buildRustPackage rec {
pname = "handlr";
2021-05-01 05:39:10 +01:00
version = "0.6.4";
2021-03-18 21:03:55 +00:00
src = fetchFromGitHub {
owner = "chmln";
repo = pname;
rev = "v${version}";
2021-05-01 05:39:10 +01:00
sha256 = "sha256-UYcJtBwbUDqDiRoj5PmO+urURfd7S7fSx2XhQRBrKTE=";
2021-03-18 21:03:55 +00:00
};
2021-05-01 05:39:10 +01:00
cargoSha256 = "sha256-xDQV8wVlzItz0lzR1nVRPVsg7nSf/khUhevDlGgSO3g=";
2021-03-18 21:03:55 +00:00
nativeBuildInputs = [ installShellFiles shared-mime-info ];
2021-05-16 09:08:13 +01:00
buildInputs = lib.optional stdenv.isDarwin libiconv;
preCheck = ''
export HOME=$TEMPDIR
'';
2021-03-18 21:03:55 +00:00
postInstall = ''
installShellCompletion \
--zsh completions/_handlr \
--fish completions/handlr.fish
'';
2021-03-18 21:03:55 +00:00
meta = with lib; {
description = "Alternative to xdg-open to manage default applications with ease";
homepage = "https://github.com/chmln/handlr";
license = licenses.mit;
maintainers = with maintainers; [ mredaelli ];
};
}