-
Notifications
You must be signed in to change notification settings - Fork 50
/
flake.nix
178 lines (166 loc) · 6.18 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
{
inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz";
flake-utils.url = "https://flakehub.com/f/numtide/flake-utils/*.tar.gz";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
with nixpkgs.legacyPackages.${system}; rec {
defaultPackage = buildGoModule rec {
name = "protoc-gen-go-drpc";
src = builtins.path {
path = ./.;
name = "${name}-src";
filter = (path: type: builtins.elem path (builtins.map toString [
./cmd
./cmd/protoc-gen-go-drpc
./cmd/protoc-gen-go-drpc/main.go
./go.mod
./go.sum
]));
};
subPackages = [ "cmd/protoc-gen-go-drpc" ];
vendorHash = "sha256-NMa9c+QIq9VEUQZqZ5X9fNbZDJT99q8XNCH2rRKyMzQ=";
};
devShell =
let devtools = {
staticcheck = buildGoModule {
name = "staticcheck";
src = fetchFromGitHub {
owner = "dominikh";
repo = "go-tools";
rev = "2023.1.2";
sha256 = "sha256-Xnylkv0n3FExQ4e4pmD6DAUqGtud80wHHoVY56UXfOU";
};
doCheck = false;
subPackages = [ "cmd/staticcheck" ];
vendorHash = "sha256-o9UtS6AMgRYuAkOWdktG2Kr3QDBDQTOGSlya69K2br8";
};
golangci-lint = buildGoModule rec {
name = "golangci-lint";
version = "1.55.0";
src = fetchFromGitHub {
owner = "golangci";
repo = "golangci-lint";
rev = "v${version}";
hash = "sha256-77bhXeABkV6WZCzoGnRS447pEVcJyj4AF+wihJe62fc=";
};
doCheck = false;
subPackages = [ "cmd/golangci-lint" ];
vendorHash = "sha256-3aHLilu+AZ6376bn9eS8kmSfo6fXikOFJKDRCYu+4a0=";
ldflags = ["-X main.version=${version}" "-X main.commit=v${version}" "-X main.date=19700101-00:00:00"];
};
ci = buildGoModule {
name = "ci";
src = fetchFromGitHub {
owner = "storj";
repo = "ci";
rev = "37130d944fc8b60928fd460fe53ebaa7204c8102";
sha256 = "sha256-NcsLA5d5sF1qSPSu/Pw/Md+0nr+inXAsPx9bKWh3I7Y=";
};
doCheck = false;
vendorHash = "sha256-G5cAb9zFqjdCLIodGcPv9u4ABZZKEGTx0CvB4i7JdRg=";
allowGoReference = true; # until check-imports stops needing this
subPackages = [
"check-copyright"
"check-large-files"
"check-imports"
"check-atomic-align"
"check-errs"
];
};
protoc-gen-go-grpc = buildGoModule {
name = "protoc-gen-go-grpc";
src = fetchFromGitHub {
owner = "grpc";
repo = "grpc-go";
rev = "v1.36.0";
sha256 = "sha256-sUDeWY/yMyijbKsXDBwBXLShXTAZ4445I4hpP7bTndQ=";
};
doCheck = false;
vendorHash = "sha256-KHd9zmNsmXmc2+NNtTnw/CSkmGwcBVYNrpEUmIoZi5Q=";
modRoot = "./cmd/protoc-gen-go-grpc";
};
protoc-gen-go = buildGoModule {
name = "protoc-gen-go";
src = fetchFromGitHub {
owner = "protocolbuffers";
repo = "protobuf-go";
rev = "v1.27.1";
sha256 = "sha256-wkUvMsoJP38KMD5b3Fz65R1cnpeTtDcVqgE7tNlZXys=";
};
doCheck = false;
vendorHash = null;
modRoot = "./cmd/protoc-gen-go";
};
protoc-gen-gogo = buildGoPackage {
name = "protoc-gen-gogo";
src = fetchFromGitHub {
owner = "gogo";
repo = "protobuf";
rev = "v1.3.2";
sha256 = "sha256-CoUqgLFnLNCS9OxKFS7XwjE17SlH6iL1Kgv+0uEK2zU=";
};
doCheck = false;
goPackagePath = "github.com/gogo/protobuf";
subPackages = [ "./protoc-gen-gogo" ];
};
protoc-gen-twirp = buildGoPackage {
name = "protoc-gen-twirp";
src = fetchFromGitHub {
owner = "twitchtv";
repo = "twirp";
rev = "v8.1.3";
sha256 = "sha256-p3gHVHGBHakOOQnJAuMK7vZumNXN15mOABuEHUG0wNs=";
};
doCheck = false;
goPackagePath = "github.com/twitchtv/twirp";
subPackages = [ "./protoc-gen-twirp" ];
};
stringer = buildGoModule {
name = "stringer";
src = fetchFromGitHub {
owner = "golang";
repo = "tools";
rev = "v0.3.0";
sha256 = "sha256-UMEhFxODGQ20vkZPtscBpHhUDa6/+hnD85Z1yx0pQfQ=";
};
doCheck = false;
vendorHash = "sha256-EQHYf4Q+XNjwG/KDoTA4m0mlBGxPkJSLUcO0VHFSpeA=";
subPackages = [ "cmd/stringer" ];
};
godocdown = buildGoPackage {
name = "godocdown";
src = fetchFromGitHub {
owner = "robertkrimen";
repo = "godocdown";
rev = "0bfa0490548148882a54c15fbc52a621a9f50cbe";
sha256 = "sha256-5gGun9CTvI3VNsMudJ6zjrViy6Zk00NuJ4pZJbzY/Uk=";
};
doCheck = false;
goPackagePath = "github.com/robertkrimen/godocdown";
subPackages = [ "./godocdown" ];
};
};
in mkShell {
buildInputs = [
defaultPackage
go_1_21
protobuf
graphviz
bash
gnumake
devtools.protoc-gen-go-grpc
devtools.protoc-gen-go
devtools.protoc-gen-gogo
devtools.protoc-gen-twirp
devtools.staticcheck
devtools.golangci-lint
devtools.ci
devtools.stringer
devtools.godocdown
];
};
}
);
}