forked from
lass.pds.lassul.us/superconfig
This repository has no description
1.4 kB
69 lines
1{
2 stdenv,
3
4 buf,
5 fetchPnpmDeps,
6 nodejs,
7 pnpm_10,
8 pnpmConfigHook,
9
10 protoImage,
11 version,
12 zitadelRepo,
13}:
14
15let
16 pnpm = pnpm_10;
17
18 # The workspace packages the console needs out of the repository-wide
19 # pnpm-lock.yaml.
20 pnpmDeps = fetchPnpmDeps {
21 pname = "zitadel";
22 inherit version pnpm;
23 src = zitadelRepo;
24 fetcherVersion = 4;
25 pnpmWorkspaces = [
26 "@zitadel/client"
27 "@zitadel/console"
28 "@zitadel/proto"
29 ];
30 hash = "sha256-8eW45vFB295KGIxdGIu+gpC9YDwZj0V+CTBZjx3i8aU=";
31 };
32
33 # packages/zitadel-proto, generated by @bufbuild/protoc-gen-es from its npm
34 # dev dependencies against protoImage instead of the proto tree.
35 protoPackageGenerated = stdenv.mkDerivation {
36 pname = "zitadel-proto-buf-generated";
37 inherit version;
38
39 src = zitadelRepo;
40
41 inherit pnpmDeps;
42 pnpmWorkspaces = [ "@zitadel/proto" ];
43
44 nativeBuildInputs = [
45 buf
46 nodejs
47 pnpm
48 pnpmConfigHook
49 ];
50
51 buildPhase = ''
52 runHook preBuild
53 cd packages/zitadel-proto
54 export PATH="$PWD/node_modules/.bin:$PATH"
55 HOME=$TMPDIR buf generate ${protoImage}#format=binpb
56 runHook postBuild
57 '';
58
59 installPhase = ''
60 runHook preInstall
61 mkdir -p $out
62 cp -r es cjs types $out/
63 runHook postInstall
64 '';
65 };
66in
67{
68 inherit pnpm pnpmDeps protoPackageGenerated;
69}