nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 fetchpatch,
6 installShellFiles,
7}:
8
9buildGoModule rec {
10 pname = "sift";
11 version = "0.9.0";
12
13 src = fetchFromGitHub {
14 owner = "svent";
15 repo = "sift";
16 rev = "v${version}";
17 hash = "sha256-IZ4Hwg5NzdSXtrIDNxtkzquuiHQOmLV1HSx8gpwE/i0=";
18 };
19
20 vendorHash = "sha256-y883la4R4jhsS99/ohgBC9SHggybAq9hreda6quG3IY=";
21
22 patches = [
23 # Add Go Modules support
24 (fetchpatch {
25 url = "https://github.com/svent/sift/commit/b56fb3d0fd914c8a6c08b148e15dd8a07c7d8a5a.patch";
26 hash = "sha256-mFCEpkgQ8XDPRQ3yKDZ5qY9tKGSuHs+RnhMeAlx33Ng=";
27 })
28 ];
29
30 nativeBuildInputs = [ installShellFiles ];
31
32 ldflags = [
33 "-s"
34 "-w"
35 ];
36
37 postInstall = ''
38 installShellCompletion --cmd sift --bash sift-completion.bash
39 '';
40
41 meta = {
42 description = "Fast and powerful alternative to grep";
43 mainProgram = "sift";
44 homepage = "https://sift-tool.org";
45 maintainers = with lib.maintainers; [ viraptor ];
46 license = lib.licenses.gpl3;
47 };
48}