Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ee30c177c | |||
| 7177130c03 | |||
| 1965741625 | |||
| 220aaaa08c | |||
| 56bbcd22d1 | |||
| bb57488dbc | |||
| 2413926ad8 | |||
| 1f0c39b015 | |||
| fc0fdb09a4 | |||
| f85b2e3d7b | |||
| 85638d6aa4 | |||
| 81e55657d9 |
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"version": 1,
|
||||||
|
"sourceRepo": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos.git",
|
||||||
|
"sourceCommit": "fa363fa2f4e83d0996c1229ab1ecf9e0541d5d4f",
|
||||||
|
"sourcePath": "quixos-instance/quixos-nix-helpers",
|
||||||
|
"exportName": "quixos-nix-helpers",
|
||||||
|
"mirrorRemote": "https://gitea-external.egads.tutti.syntaxblitz.net/quixos/quixos-nix-helpers.git"
|
||||||
|
}
|
||||||
+20
-12
@@ -521,7 +521,6 @@ EOF
|
|||||||
promptName ? null,
|
promptName ? null,
|
||||||
nodejsAttr ? "nodejs_24",
|
nodejsAttr ? "nodejs_24",
|
||||||
buildCommand ? "yarn build",
|
buildCommand ? "yarn build",
|
||||||
sourcePortals ? { },
|
|
||||||
buildEnv ? { },
|
buildEnv ? { },
|
||||||
nativeBuildInputs ? [ ],
|
nativeBuildInputs ? [ ],
|
||||||
devShellPackages ? [ ],
|
devShellPackages ? [ ],
|
||||||
@@ -561,19 +560,20 @@ EOF
|
|||||||
attrs
|
attrs
|
||||||
);
|
);
|
||||||
|
|
||||||
portalLinksFor = attrs:
|
|
||||||
lib.concatStringsSep "\n" (
|
|
||||||
lib.mapAttrsToList
|
|
||||||
(target: source: "ln -sfn ${source} ${lib.escapeShellArg target}")
|
|
||||||
attrs
|
|
||||||
);
|
|
||||||
|
|
||||||
bundleConfig = if bundle == null then { } else bundle;
|
bundleConfig = if bundle == null then { } else bundle;
|
||||||
bundleOutfile = bundleConfig.outfile or "server.mjs";
|
bundleOutfile = bundleConfig.outfile or "server.mjs";
|
||||||
bundlePlatform = bundleConfig.platform or "node";
|
bundlePlatform = bundleConfig.platform or "node";
|
||||||
bundleTarget = bundleConfig.target or "node24";
|
bundleTarget = bundleConfig.target or "node24";
|
||||||
bundleFormat = bundleConfig.format or "esm";
|
bundleFormat = bundleConfig.format or "esm";
|
||||||
bundleBanner = bundleConfig.banner or nodeRequireBanner;
|
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);";
|
nodeRequireBanner = "import { createRequire } from 'module';const require = createRequire(import.meta.url);";
|
||||||
bundleCommand =
|
bundleCommand =
|
||||||
if bundle == null
|
if bundle == null
|
||||||
@@ -584,6 +584,7 @@ EOF
|
|||||||
--platform=${bundlePlatform} \
|
--platform=${bundlePlatform} \
|
||||||
--target=${bundleTarget} \
|
--target=${bundleTarget} \
|
||||||
--format=${bundleFormat} \
|
--format=${bundleFormat} \
|
||||||
|
${bundleAliasArgs} \
|
||||||
${lib.optionalString (bundleConfig.preserveSymlinks or true) "--preserve-symlinks \\"}
|
${lib.optionalString (bundleConfig.preserveSymlinks or true) "--preserve-symlinks \\"}
|
||||||
--banner:js=${lib.escapeShellArg bundleBanner} \
|
--banner:js=${lib.escapeShellArg bundleBanner} \
|
||||||
--outfile=${lib.escapeShellArg bundleOutfile}
|
--outfile=${lib.escapeShellArg bundleOutfile}
|
||||||
@@ -595,12 +596,22 @@ EOF
|
|||||||
installConfig.libexecName or (lib.strings.sanitizeDerivationName packageNameFinal);
|
installConfig.libexecName or (lib.strings.sanitizeDerivationName packageNameFinal);
|
||||||
serverFile = installConfig.serverFile or bundleOutfile;
|
serverFile = installConfig.serverFile or bundleOutfile;
|
||||||
descriptorPath = installConfig.descriptorPath or "descriptor.quixos-package.txtpb";
|
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 =
|
installServerPhase =
|
||||||
if installServer == null
|
if installServer == null
|
||||||
then null
|
then null
|
||||||
else ''
|
else ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
install -Dm755 ${lib.escapeShellArg serverFile} "$out/libexec/${serverLibexecName}/${serverFile}"
|
install -Dm755 ${lib.escapeShellArg serverFile} "$out/libexec/${serverLibexecName}/${serverFile}"
|
||||||
|
${lib.concatMapStringsSep "\n" installExtraFile extraFiles}
|
||||||
mkdir -p "$out/bin"
|
mkdir -p "$out/bin"
|
||||||
cat > "$out/bin/${serverBin}" <<EOF
|
cat > "$out/bin/${serverBin}" <<EOF
|
||||||
#!${pkgs.runtimeShell}
|
#!${pkgs.runtimeShell}
|
||||||
@@ -620,9 +631,6 @@ EOF
|
|||||||
(old.nativeBuildInputs or [ ])
|
(old.nativeBuildInputs or [ ])
|
||||||
++ lib.optional (bundle != null) pkgs.esbuild
|
++ lib.optional (bundle != null) pkgs.esbuild
|
||||||
++ callOption nativeBuildInputs;
|
++ callOption nativeBuildInputs;
|
||||||
preConfigure = (old.preConfigure or "") + ''
|
|
||||||
${portalLinksFor (callOption sourcePortals)}
|
|
||||||
'';
|
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
runHook preBuild
|
runHook preBuild
|
||||||
${exportsFor (callOption buildEnv)}
|
${exportsFor (callOption buildEnv)}
|
||||||
@@ -662,7 +670,7 @@ EOF
|
|||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
packages = [
|
packages = [
|
||||||
nodejs
|
nodejs
|
||||||
pkgs.yarn-berry_4
|
project.yarn-freestanding
|
||||||
] ++ callOption devShellPackages;
|
] ++ callOption devShellPackages;
|
||||||
shellHook = devShellHookBase + callOption devShellHook;
|
shellHook = devShellHookBase + callOption devShellHook;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user