From db0c63f3f47066c0e61f59723a5183f6397b9cdb Mon Sep 17 00:00:00 2001 From: Brysen Pfingsten Date: Tue, 16 Jun 2026 22:59:17 -0400 Subject: [PATCH] Fix shell.nix and build for modern nixpkgs/Node.js - Update nodejs-14_x to nodejs_20 (Node 14 EOL, removed from nixpkgs) - Fix xvfb_run -> xvfb-run attribute rename - Remove xvfb-run patch that no longer applies (buildCommand removed) - Add NODE_OPTIONS=--openssl-legacy-provider for webpack compatibility with Node.js 17+ (OpenSSL 3.0 breaks legacy crypto in older webpack) Co-Authored-By: Claude Opus 4.5 --- APIServer/start.sh | 2 +- shell.nix | 23 ++--------------------- 2 files changed, 3 insertions(+), 22 deletions(-) diff --git a/APIServer/start.sh b/APIServer/start.sh index 2c61f80..d8550dd 100755 --- a/APIServer/start.sh +++ b/APIServer/start.sh @@ -83,7 +83,7 @@ if [ $needsBuild -eq 1 ]; then echo "could install depenencies, is yarn instlled?" exit 1 ) - yarn run grunt || + NODE_OPTIONS=--openssl-legacy-provider yarn run grunt || ( echo "could not build the server" exit 1 diff --git a/shell.nix b/shell.nix index 62ab623..1c6868e 100644 --- a/shell.nix +++ b/shell.nix @@ -1,25 +1,6 @@ { pkgs ? import { }, stdenv ? pkgs.stdenv }: let - xvfb-run-stderr = pkgs.xvfb_run.overrideAttrs (drv: { - # Patch the wrapped program by appending this to the buildCommand - buildCommand = drv.buildCommand + '' - - patch $out/bin/.xvfb-run-wrapped << 'HERE' - ---- xvfb-run 2019-02-28 06:18:21.000000000 +0000 -+++ xvfb-run 2019-03-04 12:37:31.129377336 +0000 -@@ -178,7 +178,7 @@ - - # Start the command and save its exit status. - set +e --DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1 -+DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" - RETVAL=$? - set -e -HERE - ''; - }); - node = pkgs.nodejs-14_x; + node = pkgs.nodejs_20; yarn = pkgs.yarn.override { nodejs = node; }; in pkgs.mkShell { @@ -32,7 +13,7 @@ pkgs.mkShell { pkgs.curl node yarn - xvfb-run-stderr + pkgs.xvfb-run ]; shellHook = '' echo "settup env"