nixpkgs/pkgs/tools/text/sift/default.nix

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

40 lines
1,008 B
Nix
Raw Normal View History

2023-01-24 02:04:06 +01:00
{ lib, buildGoModule, fetchFromGitHub, fetchpatch, installShellFiles }:
2023-01-24 02:04:06 +01:00
buildGoModule rec {
pname = "sift";
2018-02-14 22:34:31 +01:00
version = "0.9.0";
2022-05-05 13:07:46 +02:00
src = fetchFromGitHub {
owner = "svent";
repo = "sift";
2023-01-24 02:04:06 +01:00
rev = "v${version}";
hash = "sha256-IZ4Hwg5NzdSXtrIDNxtkzquuiHQOmLV1HSx8gpwE/i0=";
};
2023-01-24 02:04:06 +01:00
vendorHash = "sha256-y883la4R4jhsS99/ohgBC9SHggybAq9hreda6quG3IY=";
patches = [
# Add Go Modules support
(fetchpatch {
url = "https://github.com/svent/sift/commit/b56fb3d0fd914c8a6c08b148e15dd8a07c7d8a5a.patch";
hash = "sha256-mFCEpkgQ8XDPRQ3yKDZ5qY9tKGSuHs+RnhMeAlx33Ng=";
})
];
nativeBuildInputs = [ installShellFiles ];
ldflags = [ "-s" "-w" ];
2022-05-05 13:07:46 +02:00
postInstall = ''
2023-01-24 02:04:06 +01:00
installShellCompletion --cmd sift --bash sift-completion.bash
2022-05-05 13:07:46 +02:00
'';
meta = with lib; {
description = "A fast and powerful alternative to grep";
mainProgram = "sift";
homepage = "https://sift-tool.org";
maintainers = with maintainers; [ viraptor ];
license = licenses.gpl3;
};
}