| 17 Jul 2024 |
@wst:imagisphe.re | { lib
, stdenv
, fetchFromGitHub
, fetchYarnDeps
, yarn2nix
, yarn
}:
stdenv.mkDerivation rec {
pname = "jan";
version = "0.5.2";
src = fetchFromGitHub {
owner = "janhq";
repo = pname;
rev = "v${version}";
hash = "sha256-MByI66+fmHQOMMlpA/uJ9/iL8ImAr7XbzW4Hht7CeDM=";
};
offlineCache = fetchYarnDeps {
yarnLock = ./yarn.lock;
sha256 = lib.fakeSha256;
};
nativeBuildInputs = [
yarn2nix
yarn
];
buildPhase = ''
cd joi
yarn2nix
yarn build
'';
meta = {
homepage = "https://jan.ai";
license = lib.licenses.gpl3Only;
};
}
| 21:13:48 |
@wst:imagisphe.re | As far as I understood from makefile of the project I need to first cd to joi subfolder and build yarn dependencies and then I can put offlineCache as a nativeBuildInput to the main project | 21:15:48 |
@wst:imagisphe.re | I'm absolutely not sure about what I'm doing, so pardon my ignorance in case it doesn't make any sense | 21:16:32 |
Cobalt | Thank you, I'll try to take a look at it asap | 21:32:54 |
@wst:imagisphe.re | There's no rush. I will be happy to accept any help. | 21:38:51 |
Cobalt | So, afaict, this repo contains three node components. A web ui, a server for the corresponding backend and an electron app. The web ui and server can be used separately (see Dockerfile) and the electron app wraps the logic from the other components. You are currently trying to package the electron app. Does that sound about right? | 21:47:44 |
Cobalt | To build the electron app, you require a compiled version of the frontend. | 21:48:54 |
Cobalt | And the compiled frontend + docs needs to be copied into the electron source in copy:assets. | 21:51:33 |
@wst:imagisphe.re | Yep, that's what I'm trying to do. | 21:56:41 |
Cobalt | So my first guess would be to
- build the frontend and then
- build the electron app
in separate derivations. For 2. you would have to replicate the logic from copy:assets in the preBuild/ patchPhase phase using the compiled output from 1.
| 21:53:49 |