nixpkgs/pkgs/by-name/ha/handlr-regex/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.3 KiB
Nix
Raw Normal View History

2024-06-26 19:52:12 +00:00
{
lib,
rustPlatform,
fetchFromGitHub,
shared-mime-info,
libiconv,
installShellFiles,
nix-update-script,
2024-10-15 18:40:26 +00:00
stdenv,
2024-06-26 19:52:12 +00:00
}:
2023-05-10 21:19:52 +00:00
rustPlatform.buildRustPackage rec {
pname = "handlr-regex";
2024-10-15 18:40:26 +00:00
version = "0.12.0";
2023-05-10 21:19:52 +00:00
src = fetchFromGitHub {
owner = "Anomalocaridid";
repo = pname;
rev = "v${version}";
2024-10-15 18:40:26 +00:00
hash = "sha256-xjrETTBHqekdPn2NwpGVoRoU8mf0F4jZN2yt0k8ypRA=";
2023-05-10 21:19:52 +00:00
};
2024-10-15 18:40:26 +00:00
cargoHash = "sha256-V/daNs2vk2N6N5eUq1haxxuNyGMBLLBSmBx0JozaN5A=";
2024-06-26 19:52:12 +00:00
nativeBuildInputs = [
installShellFiles
shared-mime-info
];
2023-05-10 21:19:52 +00:00
buildInputs = [ libiconv ];
preCheck = ''
export HOME=$TEMPDIR
'';
2024-10-15 18:40:26 +00:00
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd handlr \
--zsh <(COMPLETE=zsh $out/bin/handlr) \
--bash <(COMPLETE=bash $out/bin/handlr) \
--fish <(COMPLETE=fish $out/bin/handlr)
2023-05-10 21:19:52 +00:00
2024-10-15 18:40:26 +00:00
installManPage target/release-tmp/build/handlr-regex-*/out/manual/man1/*
2023-05-10 21:19:52 +00:00
'';
2024-06-26 19:52:12 +00:00
passthru.updateScript = nix-update-script { };
2023-05-10 21:19:52 +00:00
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 ];
2023-11-27 01:17:53 +00:00
mainProgram = "handlr";
2023-05-10 21:19:52 +00:00
};
}