From af5dbd1a648e6aa7c27fb6837c48962bcbb82ef9 Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Thu, 3 Jul 2025 00:03:50 -0600 Subject: [PATCH] LAST FIX --- shell.nix | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/shell.nix b/shell.nix index 3f919f0..3a19104 100644 --- a/shell.nix +++ b/shell.nix @@ -11,10 +11,7 @@ let curl ]; - # Dependencies for Playwright's self-downloaded browsers (for macOS) - playwrightSelfDownloadLibs = with pkgs; [ - glibc - libgcc + playwrightCommonLibs = with pkgs; [ glib nss nspr @@ -24,6 +21,20 @@ let at-spi2-core cups expat + libxkbcommon + cairo + pango + fontconfig + freetype + harfbuzz + icu + libpng + gnutls + ]; + + playwrightLinuxSpecificLibs = with pkgs; [ + glibc + libgcc xorg.libX11 xorg.libxcb xorg.libXext @@ -35,31 +46,23 @@ let xorg.libXi xorg.libXrender xorg.libXtst - libxkbcommon mesa libglvnd - cairo - pango - fontconfig - freetype - harfbuzz + libdrm udev alsa-lib - icu - libdrm - libpng - gnutls ]; - # Path string for LD_LIBRARY_PATH, only for self-downloaded Playwright + playwrightSelfDownloadLibs = playwrightCommonLibs ++ (if isLinux then playwrightLinuxSpecificLibs else []); + playwrightLibPath = pkgs.lib.makeBinPath playwrightSelfDownloadLibs; in pkgs.mkShell { buildInputs = commonBuildInputs ++ ( if isDarwin - then playwrightSelfDownloadLibs - else [ pkgs.chromium ] + then playwrightCommonLibs + else [ pkgs.chromium ] ++ playwrightSelfDownloadLibs ); shellHook = '' @@ -67,9 +70,7 @@ pkgs.mkShell { echo "Node version: $(node --version)" echo "pnpm version: $(pnpm --version)" - # Conditional setup for Chromium/Playwright ${if isDarwin then '' - # macOS: Playwright downloads its own browser echo "Chromium path: Playwright will download its own for macOS" export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=false @@ -84,7 +85,6 @@ pkgs.mkShell { echo "✅ Playwright browsers already installed (for macOS)." fi '' else if isLinux then '' - # Linux: Use Nixpkgs-provided Chromium echo "Chromium path: ${pkgs.chromium}/bin/chromium" export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 export PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH="${pkgs.chromium}/bin/chromium" @@ -100,7 +100,6 @@ pkgs.mkShell { fi ''; - # Environment variables PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = if isDarwin then "0" else "1"; PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH = if isDarwin then null else "${pkgs.chromium}/bin/chromium"; PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = if isDarwin then "false" else "true";