Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

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
to run the example you can run the following in the repo root
```shell
nix build .#examples-simple --print-build-logs
```

## Quick start

See [this example](./templates/quick-start/) for a simple roc app taken form [roc-parser](https://github.com/lukewilliamboswell/roc-parser/blob/main/examples/letters.roc) which builds a roc binary using 2 external deps
See [this example](./templates/quick-start/) for a simple roc app taken from [roc-parser](https://github.com/lukewilliamboswell/roc-parser/blob/main/examples/letters.roc) which builds a roc binary using 2 external deps


you can run the following to copy the template into your current folder
Expand All @@ -17,7 +20,7 @@ you can run the following to copy the template into your current folder

## How it works

NOTE: goal is to eventually have a code gen step to reduce boiler plate like node2nix but for now its all manaul
NOTE: goal is to eventually have a code gen step to reduce boiler plate like node2nix but for now its all manual

- nix is given a list of urls of roc packages with their sha256 hash
- `downloadRocPackage` will call `fetchUrl` on each package and extract the package into a directory
Expand All @@ -29,7 +32,7 @@ NOTE: goal is to eventually have a code gen step to reduce boiler plate like nod
- [ ] TLC around how roc deps are replaced by the nix store paths. Right now its basically a regex is fine for the long urls but for local file paths there is a potential for collisions
- [ ] actually verify the blake3 checksum. (since we untar roc wont do this for us). Maybe roc could support local tar balls?
- [ ] A code gen tool to get all deps of a roc package for you

- [ ] Update to roc 0.1 syntax

## Ideas to explore

Expand All @@ -42,4 +45,4 @@ Lib setup is heavily inspired by [crane](https://github.com/ipetkov/crane)
## notes

see https://github.com/JRMurr/roc/blob/3d8884a96d44e2101ce8932336b74e2b9416e029/crates/compiler/build/src/link.rs#L437
for how roc calls out to compile different platforms
for how roc calls out to compile different platforms