Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 buildGoModule,
4 fetchFromGitHub,
5 installShellFiles,
6}:
7
8buildGoModule rec {
9 pname = "zed";
10 version = "0.30.2";
11
12 src = fetchFromGitHub {
13 owner = "authzed";
14 repo = "zed";
15 rev = "v${version}";
16 hash = "sha256-ftSgp0zxUmSTJ7lFHxFdebKrCKbsRocDkfabVpyQ5Kg=";
17 };
18
19 vendorHash = "sha256-2AkknaufRhv79c9WQtcW5oSwMptkR+FB+1/OJazyGSM=";
20
21 ldflags = [ "-X 'github.com/jzelinskie/cobrautil/v2.Version=${src.rev}'" ];
22
23 preCheck = ''
24 export NO_COLOR=true
25 '';
26
27 nativeBuildInputs = [ installShellFiles ];
28
29 postInstall = ''
30 installShellCompletion --cmd zed \
31 --bash <($out/bin/zed completion bash) \
32 --fish <($out/bin/zed completion fish) \
33 --zsh <($out/bin/zed completion zsh)
34 '';
35
36 meta = with lib; {
37 description = "Command line for managing SpiceDB";
38 mainProgram = "zed";
39 longDescription = ''
40 SpiceDB is an open-source permissions database inspired by
41 Google Zanzibar. zed is the command line client for SpiceDB.
42 '';
43 homepage = "https://authzed.com/";
44 license = licenses.asl20;
45 maintainers = with maintainers; [
46 squat
47 thoughtpolice
48 ];
49 };
50}