From a5ac27bf5058308385dc48e4cec6846fb378af50 Mon Sep 17 00:00:00 2001 From: Quinn Dougherty Date: Tue, 19 Apr 2022 13:32:35 -0400 Subject: [PATCH] ops for nixos, gitignore'd ts-lsp .log --- .gitignore | 1 + README.md | 1 + nixos.sh | 15 +++++++++++++++ 3 files changed, 17 insertions(+) create mode 100755 nixos.sh diff --git a/.gitignore b/.gitignore index f5cb3583..5b48f91c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ yarn-error.log .DS_Store **/.sync.ffs_db .direnv +.log diff --git a/README.md b/README.md index ee4d00c8..2f1de7f7 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ The playground depends on the components library which then depends on the langu # Develop For any project in the repo, begin by running `yarn` in the top level + ```sh yarn ``` diff --git a/nixos.sh b/nixos.sh new file mode 100755 index 00000000..5284c919 --- /dev/null +++ b/nixos.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -x + +fhsShellName="squiggle-development" +# Esy (a bisect_ppx dependency/build tool) is borked on nixos without using an FHS shell. https://github.com/esy/esy/issues/858 +fhsShellDotNix="{pkgs ? import {} }: (pkgs.buildFHSUserEnv { name = \"${fhsShellName}\"; targetPkgs = pkgs: [pkgs.yarn]; runScript = \"yarn\"; }).env" +nix-shell - <<<"$fhsShellDotNix" + +# We need to patchelf rescript executables. https://github.com/NixOS/nixpkgs/issues/107375 +theLd=$(patchelf --print-interpreter $(which mkdir)) +patchelf --set-interpreter $theLd ./node_modules/gentype/gentype.exe +patchelf --set-interpreter $theLd ./node_modules/rescript/linux/*.exe +patchelf --set-interpreter $theLd ./node_modules/bisect_ppx/ppx +theSo=$(find /nix/store/*$fhsShellName*/lib64 -name libstdc++.so.6 | grep squiggle-development | head -n 1) +patchelf --replace-needed libstdc++.so.6 $theSo ./node_modules/rescript/linux/ninja.exe