Files
quixos-nix-helpers/portable-artifacts.nix
T

65 lines
1.7 KiB
Nix

# Fresh artifact builder. Candidate plans and runtime dependencies are supplied by the workspace compiler.
{
pkgs,
src,
plan,
protocol,
core,
sharedRuntime,
typescript ? core.dependencies,
packageRevisionId,
portable ? null,
remote ? null,
service ? { },
nodeModules ? null,
}:
let
compiler = "${protocol}/libexec/quixos-protocol/execution-world.mjs";
config = pkgs.writeText "camino-artifact-build.json" (
builtins.toJSON {
inherit
plan
compiler
packageRevisionId
core
sharedRuntime
nodeModules
service
;
source = src;
portable =
if portable == null then
null
else
{
inherit (portable) entry;
entries = portable.entries or { };
registryExport = portable.registryExport or "registry";
bindingOutput = portable.bindingOutput or "src/gen/qx.ts";
targets =
portable.targets or [
"browser"
"server"
];
};
remote =
if remote == null then
null
else
{
inherit (remote) entry;
registryExport = remote.registryExport or "registry";
bindingOutput = remote.bindingOutput or "src/gen/remote.ts";
};
node = "${pkgs.nodejs_24}/bin/node";
tsc = "${typescript}/node_modules/typescript/bin/tsc";
esbuild = "${pkgs.esbuild}/bin/esbuild";
shell = "${pkgs.runtimeShell}";
serviceAdapter = ./portable-service.mjs;
}
);
in
pkgs.runCommand "camino-checked-artifacts" { } ''
${pkgs.nodejs_24}/bin/node ${./build-portable-artifacts.mjs} ${config}
''