Skip to content

Latest commit

 

History

History
54 lines (45 loc) · 1.32 KB

nix.md

File metadata and controls

54 lines (45 loc) · 1.32 KB

Try out

To quickly try out roc without installing, use nix run:

nix run github:roc-lang/roc -- <roc args>
# examples:
# - nix run github:roc-lang/roc -- repl
# - nix run github:roc-lang/roc -- dev main.roc

Use with Flakes

Start your project with our template

# use the template in the current directory
nix flake init --template github:roc-lang/roc#simple --refresh

Add roc to existing flake

{
    inputs = {
        nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
        flake-utils.url = "github:numtide/flake-utils";
        roc.url = "github:roc-lang/roc";
    };

    outputs = {nixpkgs, roc, flake-utils, ...}:
        flake-utils.lib.eachDefaultSystem (system:
            let
                pkgs = import nixpkgs { inherit system; };
                rocPkgs = roc.packages.${system};
            in
            {
                devShells = {
                    default = pkgs.mkShell {
                        buildInputs = with pkgs;
                        [
                            rocPkgs.cli
                        ];
                    };
                };
            }
        );
}

Next Steps