ops for nixos, gitignore'd ts-lsp .log

This commit is contained in:
Quinn Dougherty 2022-04-19 13:32:35 -04:00
parent 656ad92f40
commit a5ac27bf50
3 changed files with 17 additions and 0 deletions

1
.gitignore vendored
View File

@ -6,3 +6,4 @@ yarn-error.log
.DS_Store
**/.sync.ffs_db
.direnv
.log

View File

@ -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
```

15
nixos.sh Executable file
View File

@ -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 <nixpkgs> {} }: (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