From 47bfbb278a281578e4dff04ff87e465090b0af34 Mon Sep 17 00:00:00 2001 From: MythEclipse Date: Mon, 1 Jun 2026 12:46:23 +0700 Subject: [PATCH] fix: install coreutils for sed in NixOS container The node-pre-gyp and prebuild-install wrapper scripts require sed, which is not in PATH in the NixOS base container. Install coreutils first to provide sed, dirname, basename, and other core utilities needed by native module post-install scripts. Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0e48e90..c710f03 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,14 +4,12 @@ SHELL ["/bin/sh", "-c"] ENV NIX_CONFIG="experimental-features = nix-command flakes" -# Install packages one at a time to avoid file conflicts in nix profile. -# When installing multiple packages simultaneously, nix may resolve -# different versions of shared dependencies (e.g., cacert 3.123 vs 3.117) -# which causes "An existing package already provides" errors. -# We install the big packages first (which pull their own cacert), -# then install standalone cacert last to upgrade, using --allow-import. +# Install the system tools needed for native module post-install scripts. +# Note: NixOS base image does NOT include coreutils (sed, etc.) in PATH. +# The node-pre-gyp and prebuild-install wrappers require sed. ARG NIXPKGS_COMMIT=64c08a7ca051951c8eae34e3e3cb1e202fe36786 +RUN nix profile add "github:NixOS/nixpkgs/${NIXPKGS_COMMIT}#coreutils" RUN nix profile add "github:NixOS/nixpkgs/${NIXPKGS_COMMIT}#nodejs_22" RUN nix profile add "github:NixOS/nixpkgs/${NIXPKGS_COMMIT}#ffmpeg" RUN nix profile add "github:NixOS/nixpkgs/${NIXPKGS_COMMIT}#python3"