Anyone using nix sandboxing for Reason/Ocaml projects?


#1

Hi, i am just currious if anyone tried or is using nix.


#2

Hey I don’t know much about nix. but reason team is building a solution for sandboxing. check it out https://esy.sh


#3

Hey, yes i saw esy, last time i talked with Andrey he told me that it was inspired by nix. What i like about nix is the whole environment, its not just package manager, you get amazing project sandboxing even for global dependencies, you can jump into any project with nix-shell. Gabriel has a nice setup for haskell projects https://github.com/Gabriel439/haskell-nix probably i should just try that out. My Linux machines are also configured with nixos, and i love it so far.


#4

I use NixOS for few years now and I started to do some basic stuff in Reason/OCaml recently, but I’m now trying to learn more how Reason/OCaml ecosystem works to possibly automate it in the future. I done this before with go2nix for Go projects.
I was looking a little at opam2nix and node2nix as it seems as a good starting point but I didn’t do anything more usable for now. What I do now is a simple nix-shell to have working node and OCaml environment and use npm and opam for dependencies https://github.com/kamilchm/bs-hyperdb/blob/master/shell.nix

There’s also a good example of using yarn2nix that can be helpful https://lastlog.de/blog/posts/nix-language-atlas-javascript.html