Nix builder for roc code
Very much a work in progress but basic nix building works
to run the example you can run nix build .#examples-simple --print-build-logs
in the repo root
See this example for a simple roc app taken form roc-parser which builds a roc binary using 2 external deps
you can run the following to copy the template into your current folder
nix flake init --template github:JRMurr/roc2nix#quick-start --refresh
NOTE: goal is to eventually have a code gen step to reduce boiler plate like node2nix but for now its all manaul
downloadRocPackage
will call fetchUrl
on each package and extract the package into a directorymkRocDerivation
will replace all references to the package url with the now local path and build with the provided roc compilerevalModules
or flakeParts
to make it easier to compose all the needed builds + have better input validationLib setup is heavily inspired by crane
see https://github.com/JRMurr/roc/blob/3d8884a96d44e2101ce8932336b74e2b9416e029/crates/compiler/build/src/link.rs#L437 for how roc calls out to compile different platforms