|
|
|
@@ -574,14 +574,6 @@ EOF
|
|
|
|
|
bundleTarget = bundleConfig.target or "node24";
|
|
|
|
|
bundleFormat = bundleConfig.format or "esm";
|
|
|
|
|
bundleBanner = bundleConfig.banner or nodeRequireBanner;
|
|
|
|
|
bundleAliases = bundleConfig.aliases or {
|
|
|
|
|
"@automerge/automerge" = "./node_modules/@automerge/automerge/dist/mjs/entrypoints/fullfat_base64.js";
|
|
|
|
|
};
|
|
|
|
|
bundleAliasArgs = lib.concatStringsSep " " (
|
|
|
|
|
lib.mapAttrsToList
|
|
|
|
|
(from: to: "--alias:${from}=${lib.escapeShellArg to}")
|
|
|
|
|
bundleAliases
|
|
|
|
|
);
|
|
|
|
|
nodeRequireBanner = "import { createRequire } from 'module';const require = createRequire(import.meta.url);";
|
|
|
|
|
bundleCommand =
|
|
|
|
|
if bundle == null
|
|
|
|
@@ -592,7 +584,6 @@ EOF
|
|
|
|
|
--platform=${bundlePlatform} \
|
|
|
|
|
--target=${bundleTarget} \
|
|
|
|
|
--format=${bundleFormat} \
|
|
|
|
|
${bundleAliasArgs} \
|
|
|
|
|
${lib.optionalString (bundleConfig.preserveSymlinks or true) "--preserve-symlinks \\"}
|
|
|
|
|
--banner:js=${lib.escapeShellArg bundleBanner} \
|
|
|
|
|
--outfile=${lib.escapeShellArg bundleOutfile}
|
|
|
|
@@ -604,22 +595,12 @@ EOF
|
|
|
|
|
installConfig.libexecName or (lib.strings.sanitizeDerivationName packageNameFinal);
|
|
|
|
|
serverFile = installConfig.serverFile or bundleOutfile;
|
|
|
|
|
descriptorPath = installConfig.descriptorPath or "descriptor.quixos-package.txtpb";
|
|
|
|
|
extraFiles = installConfig.extraFiles or [ ];
|
|
|
|
|
installExtraFile = file:
|
|
|
|
|
let
|
|
|
|
|
source = toString file.source;
|
|
|
|
|
target = file.target or (baseNameOf source);
|
|
|
|
|
mode = file.mode or "0644";
|
|
|
|
|
in ''
|
|
|
|
|
install -Dm${toString mode} ${lib.escapeShellArg source} "$out/libexec/${serverLibexecName}/${target}"
|
|
|
|
|
'';
|
|
|
|
|
installServerPhase =
|
|
|
|
|
if installServer == null
|
|
|
|
|
then null
|
|
|
|
|
else ''
|
|
|
|
|
runHook preInstall
|
|
|
|
|
install -Dm755 ${lib.escapeShellArg serverFile} "$out/libexec/${serverLibexecName}/${serverFile}"
|
|
|
|
|
${lib.concatMapStringsSep "\n" installExtraFile extraFiles}
|
|
|
|
|
mkdir -p "$out/bin"
|
|
|
|
|
cat > "$out/bin/${serverBin}" <<EOF
|
|
|
|
|
#!${pkgs.runtimeShell}
|
|
|
|
|