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 = "spicedb";
10 version = "1.45.1";
11
12 src = fetchFromGitHub {
13 owner = "authzed";
14 repo = "spicedb";
15 rev = "v${version}";
16 hash = "sha256-cKCAA9C0vsCa0BszspvPfrKbdWyaccrMtiO6UWhLIh4=";
17 };
18
19 vendorHash = "sha256-R4lOmHIBgnlvOukMjXdVx5e9Oneo1EizhsrDXiTbwTc=";
20
21 ldflags = [
22 "-X 'github.com/jzelinskie/cobrautil/v2.Version=${src.rev}'"
23 ];
24
25 subPackages = [ "cmd/spicedb" ];
26
27 nativeBuildInputs = [ installShellFiles ];
28
29 postInstall = ''
30 installShellCompletion --cmd spicedb \
31 --bash <($out/bin/spicedb completion bash) \
32 --fish <($out/bin/spicedb completion fish) \
33 --zsh <($out/bin/spicedb completion zsh)
34 '';
35
36 meta = with lib; {
37 description = "Open source permission database";
38 longDescription = ''
39 SpiceDB is an open-source permissions database inspired by
40 Google Zanzibar.
41 '';
42 homepage = "https://authzed.com/";
43 license = licenses.asl20;
44 maintainers = with maintainers; [
45 squat
46 thoughtpolice
47 ];
48 mainProgram = "spicedb";
49 };
50}