nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 generateProtobufCode,
3 version,
4 zitadelRepo,
5}:
6
7{
8 stdenv,
9 fetchYarnDeps,
10 yarnConfigHook,
11 yarnBuildHook,
12 nodejs,
13
14 grpc-gateway,
15 protoc-gen-grpc-web,
16 protoc-gen-js,
17}:
18
19let
20 protobufGenerated = generateProtobufCode {
21 pname = "zitadel-console";
22 inherit version;
23 nativeBuildInputs = [
24 grpc-gateway
25 protoc-gen-grpc-web
26 protoc-gen-js
27 ];
28 workDir = "console";
29 bufArgs = "../proto --include-imports --include-wkt";
30 outputPath = "src/app/proto";
31 hash = "sha256-UzmwUUYg0my3noAQNtlUEBQ+K6GVnBSkWj4CzoaoLKw=";
32 };
33in
34stdenv.mkDerivation {
35 pname = "zitadel-console";
36 inherit version;
37
38 src = zitadelRepo;
39
40 sourceRoot = "${zitadelRepo.name}/console";
41
42 offlineCache = fetchYarnDeps {
43 yarnLock = "${zitadelRepo}/console/yarn.lock";
44 hash = "sha256-ekgLd5DTOBZWuT63QnTjx40ZYvLKZh+FXCn+h5vj9qQ=";
45 };
46
47 nativeBuildInputs = [
48 yarnConfigHook
49 yarnBuildHook
50 nodejs
51 ];
52
53 preBuild = ''
54 cp -r ${protobufGenerated} src/app/proto
55 '';
56
57 installPhase = ''
58 runHook preInstall
59 cp -r dist/console "$out"
60 runHook postInstall
61 '';
62}