aboutsummaryrefslogtreecommitdiffstats
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--flake.nix64
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
+ ];
+ };
+ });
+ };
+}