support nix run and add basic doc

This commit is contained in:
John Murray 2023-12-11 23:20:28 -05:00
parent ce7fb7ec50
commit e853d3b5ac
No known key found for this signature in database
3 changed files with 22 additions and 2 deletions

View File

@ -148,5 +148,12 @@
cli = rocBuild.roc-cli;
lang-server = rocBuild.roc-lang-server;
};
apps = {
default = {
type = "app";
program = "${rocBuild.roc-cli}/bin/roc";
};
};
});
}

View File

@ -1,7 +1,11 @@
# Roc installation guide for Nix
## NixOS quick start
If you want to quickly get started you can do
```shell
nix run roc-lang/roc -- <roc args>
# example nix run roc-lang/roc -- repl
```
to try out roc!
<details>
<summary>

View File

@ -3,6 +3,8 @@ let
inherit (compile-deps) zigPkg llvmPkgs llvmVersion llvmMajorMinorStr glibcPath libGccSPath;
subPackagePath = if subPackage != null then "crates/${subPackage}" else null;
mainBin = if subPackage == "lang_srv" then "roc_ls" else "roc";
in
rustPlatform.buildRustPackage {
pname = "roc" + lib.optionalString (subPackage != null) "_${subPackage}";
@ -84,4 +86,11 @@ rustPlatform.buildRustPackage {
${wrapRoc}
fi
'';
# https://ryantm.github.io/nixpkgs/stdenv/meta/
meta = {
homepage = "https://www.roc-lang.org/";
license = lib.licenses.upl;
mainProgram = mainBin;
};
}