diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-07-11 02:52:25 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-07-11 02:52:25 -0300 |
| commit | 59c3b1a20aae2ef9c45e74d454337c07aa43f59e (patch) | |
| tree | cd6b687c4d61b64731405a017668e2380c68ed9c /flake.nix | |
| parent | e3ff4fe110d530713fa0c86522d22395f164769a (diff) | |
| download | SOL-59c3b1a20aae2ef9c45e74d454337c07aa43f59e.tar.gz SOL-59c3b1a20aae2ef9c45e74d454337c07aa43f59e.zip | |
nix flake with dune and rocq development environment
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..77264eb --- /dev/null +++ b/flake.nix @@ -0,0 +1,64 @@ +{ + description = "Sol: a total relational language and its virtual machine"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + outputs = { self, nixpkgs }: + let + systems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + forAllSystems = f: + nixpkgs.lib.genAttrs systems (system: + f (import nixpkgs { inherit system; })); + in + { + packages = forAllSystems (pkgs: + let ocamlPackages = pkgs.ocamlPackages; in + { + default = ocamlPackages.buildDunePackage { + pname = "sol"; + version = "0.1.0"; + duneVersion = "3"; + src = self; + + propagatedBuildInputs = [ + ocamlPackages.zarith + ]; + checkInputs = [ ocamlPackages.alcotest ]; + doCheck = true; + + meta = { + description = "Sol: a total relational language"; + license = pkgs.lib.licenses.agpl3Only; + maintainers = [ { name = "Marcos Magueta"; } ]; + }; + }; + }); + + devShells = forAllSystems (pkgs: + let ocamlPackages = pkgs.ocamlPackages; in + { + default = pkgs.mkShell { + inputsFrom = [ self.packages.${pkgs.system}.default ]; + packages = [ + pkgs.dune_3 + ocamlPackages.ocaml + ocamlPackages.ocaml-lsp + ocamlPackages.ocamlformat + ocamlPackages.utop + ocamlPackages.odoc + ocamlPackages.zarith + ocamlPackages.alcotest + ocamlPackages.menhir + # Rocq, for the verified checkers and their extraction + pkgs.coq + ]; + }; + }); + }; +} |
