Skip to content

Commit

Permalink
zitadel.console: remove mkYarnPackage usage
Browse files Browse the repository at this point in the history
  • Loading branch information
TomaSajt committed Oct 29, 2024
1 parent 1bb6b1c commit a609cb5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 122 deletions.
61 changes: 31 additions & 30 deletions pkgs/by-name/zi/zitadel/console.nix
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
{ generateProtobufCode
, version
, zitadelRepo
{
generateProtobufCode,
version,
zitadelRepo,
}:

{ mkYarnPackage
, fetchYarnDeps
, lib

, grpc-gateway
, protoc-gen-grpc-web
, protoc-gen-js
{
lib,
stdenv,
fetchYarnDeps,
yarnConfigHook,
yarnBuildHook,
nodejs,

grpc-gateway,
protoc-gen-grpc-web,
protoc-gen-js,
}:

let
Expand All @@ -26,36 +31,32 @@ let
hash = "sha256-n6BJ1gSSm66yOGdHcSea/nQbjiHZX2YX2zbFT4o75/4=";
};
in
mkYarnPackage rec {
name = "zitadel-console";
stdenv.mkDerivation {
pname = "zitadel-console";
inherit version;

src = "${zitadelRepo}/console";
src = zitadelRepo;

sourceRoot = "${zitadelRepo.name}/console";

packageJSON = ./package.json;
offlineCache = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
yarnLock = "${zitadelRepo}/console/yarn.lock";
hash = "sha256-MWATjfhIbo3cqpzOdXP52f/0Td60n99OTU1Qk6oWmXU=";
};

postPatch = ''
substituteInPlace src/styles.scss \
--replace-fail "/node_modules/flag-icons" "flag-icons"
nativeBuildInputs = [
yarnConfigHook
yarnBuildHook
nodejs
];

substituteInPlace angular.json \
--replace-fail "./node_modules/tinycolor2" "../../node_modules/tinycolor2"
'';

buildPhase = ''
ln -s "${zitadelRepo}/docs" deps/docs
mkdir deps/console/src/app/proto
cp -r ${protobufGenerated}/* deps/console/src/app/proto/
yarn --offline build
preBuild = ''
cp -r ${protobufGenerated} src/app/proto
'';

installPhase = ''
cp -r deps/console/dist/console $out
runHook preInstall
cp -r dist/console "$out"
runHook postInstall
'';

doDist = false;
}
92 changes: 0 additions & 92 deletions pkgs/by-name/zi/zitadel/package.json

This file was deleted.

0 comments on commit a609cb5

Please sign in to comment.