Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8dde1f6b82 | |||
| e0874093f2 | |||
| 0b159fcb81 | |||
| f33eee054f |
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"version": 1,
|
||||
"sourceRepo": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos.git",
|
||||
"sourceCommit": "b5db4f65b59842ba912cb89d11237d0ce428ea95",
|
||||
"sourcePath": "quixos-instance/quixos-nix-helpers",
|
||||
"exportName": "quixos-nix-helpers",
|
||||
"mirrorRemote": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-nix-helpers.git"
|
||||
}
|
||||
+12
-20
@@ -521,6 +521,7 @@ EOF
|
||||
promptName ? null,
|
||||
nodejsAttr ? "nodejs_24",
|
||||
buildCommand ? "yarn build",
|
||||
sourcePortals ? { },
|
||||
buildEnv ? { },
|
||||
nativeBuildInputs ? [ ],
|
||||
devShellPackages ? [ ],
|
||||
@@ -560,20 +561,19 @@ EOF
|
||||
attrs
|
||||
);
|
||||
|
||||
portalLinksFor = attrs:
|
||||
lib.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList
|
||||
(target: source: "ln -sfn ${source} ${lib.escapeShellArg target}")
|
||||
attrs
|
||||
);
|
||||
|
||||
bundleConfig = if bundle == null then { } else bundle;
|
||||
bundleOutfile = bundleConfig.outfile or "server.mjs";
|
||||
bundlePlatform = bundleConfig.platform or "node";
|
||||
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
|
||||
@@ -584,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}
|
||||
@@ -596,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}
|
||||
@@ -631,6 +620,9 @@ EOF
|
||||
(old.nativeBuildInputs or [ ])
|
||||
++ lib.optional (bundle != null) pkgs.esbuild
|
||||
++ callOption nativeBuildInputs;
|
||||
preConfigure = (old.preConfigure or "") + ''
|
||||
${portalLinksFor (callOption sourcePortals)}
|
||||
'';
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
${exportsFor (callOption buildEnv)}
|
||||
@@ -670,7 +662,7 @@ EOF
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = [
|
||||
nodejs
|
||||
project.yarn-freestanding
|
||||
pkgs.yarn-berry_4
|
||||
] ++ callOption devShellPackages;
|
||||
shellHook = devShellHookBase + callOption devShellHook;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user