Skip to content

Commit 4d2ba8c

Browse files
committed
Don't override package protobuf, instead export protobuf_local.
So that MacOS users can use the nix develop environment.
1 parent 7f7baa3 commit 4d2ba8c

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

flake.nix

+15-5
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,16 @@
8383
let pkgs = nixpkgsFor.${system}; in {
8484
protoc-gen-purescript = pkgs.protoc-gen-purescript;
8585
conformance-purescript = pkgs.conformance-purescript;
86+
protobuf_v3_9_2 = pkgs.protobuf_v3_9_2;
87+
protobuf_v3_14_0 = pkgs.protobuf_v3_14_0;
88+
protobuf_v3_15_8 = pkgs.protobuf_v3_15_8;
89+
protobuf_v3_20_1 = pkgs.protobuf_v3_20_1;
90+
protobuf_v3_21_0 = pkgs.protobuf_v3_21_0;
91+
protobuf_v21_10 = pkgs.protobuf_v21_10;
92+
protobuf_v23_2 = pkgs.protobuf_v23_2;
93+
protobuf_v24_4 = pkgs.protobuf_v24_4;
8694
protobuf_v28_2 = pkgs.protobuf_v28_2;
87-
protobuf = pkgs.protobuf_v28_2;
95+
protobuf_local = pkgs.protobuf_local;
8896
});
8997

9098
devShells = forAllSystems (system:
@@ -99,7 +107,9 @@
99107
purs-backend-es
100108
purescript-language-server
101109
nodejs
102-
protobuf
110+
# If MacOS then we use the protobuf from nixpkgs.
111+
# Else we use our own protobuf.
112+
(if stdenv.isDarwin then protobuf else protobuf_local)
103113
esbuild
104114
protoc-gen-purescript
105115
];
@@ -134,15 +144,15 @@
134144
let pkgs = nixpkgsFor.${system}; in {
135145
protoc = {
136146
type = "app";
137-
program = "${pkgs.protobuf}/bin/protoc";
147+
program = "${pkgs.protobuf_local}/bin/protoc";
138148
};
139149
protoc-gen-purescript = {
140150
type = "app";
141151
program = "${pkgs.protoc-gen-purescript}/bin/protoc-gen-purescript";
142152
};
143153
conformance_test_runner = {
144154
type = "app";
145-
program = "${pkgs.protobuf}/bin/conformance_test_runner";
155+
program = "${pkgs.protobuf_local}/bin/conformance_test_runner";
146156
};
147157
conformance-purescript = {
148158
type = "app";
@@ -153,7 +163,7 @@
153163
conformance-run = pkgs.writeScriptBin "conformance" ''
154164
set -e
155165
set -x
156-
${pkgs.protobuf}/bin/conformance_test_runner --enforce_recommended ${pkgs.conformance-purescript}/bin/conformance-purescript
166+
${pkgs.protobuf_local}/bin/conformance_test_runner --enforce_recommended ${pkgs.conformance-purescript}/bin/conformance-purescript
157167
'';
158168
in
159169
{

nix/protobuf.nix

+3-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ in
205205
inherit protobuf_v23_2;
206206
inherit protobuf_v24_4;
207207
inherit protobuf_v28_2;
208-
protobuf = protobuf_v28_2;
208+
# We export protobuf_local, our own local build of protobuf which includes
209+
# a build of the conformance test runner.
210+
protobuf_local = protobuf_v28_2;
209211
}
210212

211213

0 commit comments

Comments
 (0)