about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/handlr-regex/default.nix
blob: 5a52f63f0cc4f68376388657cde2f5d44526ae6c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{ lib, stdenv, rustPlatform, fetchFromGitHub, shared-mime-info, libiconv, installShellFiles }:

rustPlatform.buildRustPackage rec {
  pname = "handlr-regex";
  version = "0.8.5";

  src = fetchFromGitHub {
    owner = "Anomalocaridid";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-X0j62Ntu/ouBVm09iKxU3pps8mbL5V5gA65Maa4b0AY=";
  };

  cargoSha256 = "sha256-byR7CM876z5tAXmbcUfI0CnJrc/D6CxfjBJhuJMSFmg=";

  nativeBuildInputs = [ installShellFiles shared-mime-info ];
  buildInputs = [ libiconv ];

  preCheck = ''
    export HOME=$TEMPDIR
  '';

  postInstall = ''
    installShellCompletion \
      --zsh assets/completions/_handlr \
      --bash assets/completions/handlr \
      --fish assets/completions/handlr.fish

    installManPage assets/manual/man1/*
  '';

  meta = with lib; {
    description = "Fork of handlr with support for regex";
    homepage = "https://github.com/Anomalocaridid/handlr-regex";
    license = licenses.mit;
    maintainers = with maintainers; [ anomalocaris ];
  };
}