Skip to content

Commit

Permalink
Merge pull request #2509 from o1-labs/fizzixnerd/initial-flake
Browse files Browse the repository at this point in the history
Add initial flake for installing build dependencies for `proof-systems`
  • Loading branch information
Fizzixnerd authored Aug 29, 2024
2 parents fe46dd2 + 36b693c commit e89f27c
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,7 @@ The CI will build different targets.
When CI passes on master, the documentation built from the rust code will be
available [here](https://o1-labs.github.io/proof-systems/rustdoc) and the book
will be available [here](https://o1-labs.github.io/proof-systems).

## Nix for Dependencies (WIP)

If you have `nix` installed and in particular, `flakes` enabled, you can install the dependencies for these projects using nix. Simply `nix develop .` inside this directory to bring into scope `rustup`, `opam`, and `go` (along with a few other tools). You will have to manage the toolchains yourself using `rustup` and `opam`, in the current iteration.
37 changes: 37 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
description = "proof-system prerequisites";

inputs = {
naersk.url = "github:nix-community/naersk/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, utils, naersk }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
in
{
defaultPackage = naersk-lib.buildPackage ./.;
devShell = with pkgs; mkShell {
buildInputs = [
# rust inputs
rustup
rust-analyzer
libiconv # Needed for macOS for rustup

# ocaml inputs
opam

# go inputs
gopls
go

];
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
}
);
}

0 comments on commit e89f27c

Please sign in to comment.