Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
2
3buildGoModule rec {
4 pname = "ent-go";
5 version = "0.13.1";
6
7 src = fetchFromGitHub {
8 owner = "ent";
9 repo = "ent";
10 rev = "v${version}";
11 sha256 = "sha256-OEQWNWGVs0QYhPuCGEFgAVaUnfswmvWVt+e0cAdkBKE=";
12 };
13
14 vendorHash = "sha256-9KdSGIyi95EVQq9jGoVqK8aq3JXlQXB+Qwlh/Kfz4Oc=";
15
16 subPackages = [ "cmd/ent" ];
17
18 ldflags = [
19 "-s"
20 "-w"
21 ];
22
23 nativeBuildInputs = [ installShellFiles ];
24
25 postInstall = ''
26 installShellCompletion --cmd ent \
27 --bash <($out/bin/ent completion bash) \
28 --fish <($out/bin/ent completion fish) \
29 --zsh <($out/bin/ent completion zsh)
30 '';
31
32 meta = {
33 description = "Entity framework for Go";
34 homepage = "https://entgo.io/";
35 changelog = "https://github.com/ent/ent/releases/tag/v${version}";
36 downloadPage = "https://github.com/ent/ent";
37 license = lib.licenses.asl20;
38 maintainers = [ ];
39 mainProgram = "ent";
40 };
41}