depot/third_party/nixpkgs/pkgs/by-name/zi/zitadel/console.nix
Default email 2c76a4cb41 Project import generated by Copybara.
GitOrigin-RevId: c757e9bd77b16ca2e03c89bf8bc9ecb28e0c06ad
2023-11-16 04:20:00 +00:00

51 lines
1.1 KiB
Nix

{ generateProtobufCode
, version
, zitadelRepo
}:
{ mkYarnPackage
, fetchYarnDeps
, lib
}:
let
protobufGenerated = generateProtobufCode {
pname = "zitadel-console";
workDir = "console";
bufArgs = "../proto --include-imports --include-wkt";
outputPath = "src/app/proto";
hash = "sha256-NmlKjKWxmqatyR6OitlQ7bfl6U6PS6KWqTALwX42HS4=";
};
in
mkYarnPackage rec {
name = "zitadel-console";
inherit version;
src = "${zitadelRepo}/console";
packageJSON = ./package.json;
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
hash = "sha256-rSKoIznYVDNgrBmut7YSxNhgPJnbIeO+/s0HnrYWPUc=";
};
postPatch = ''
substituteInPlace src/styles.scss \
--replace "/node_modules/flag-icons" "flag-icons"
substituteInPlace angular.json \
--replace "./node_modules/tinycolor2" "../../node_modules/tinycolor2"
'';
buildPhase = ''
mkdir deps/console/src/app/proto
cp -r ${protobufGenerated}/* deps/console/src/app/proto/
yarn --offline build
'';
installPhase = ''
cp -r deps/console/dist/console $out
'';
doDist = false;
}