summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix63
1 files changed, 63 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..940d5fb
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,63 @@
+{
+ inputs = {
+ flake-utils.url = "github:numtide/flake-utils";
+ nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
+ ocaml.url = "github:nix-ocaml/nix-overlays";
+ ocaml.inputs.nixpkgs.follows = "nixpkgs";
+ # it's broken wtf
+ # lsp.url = "github:ocaml/ocaml-lsp";
+ # lsp.inputs.nixpkgs.follows = "nixpkgs";
+ };
+
+ outputs = {
+ self,
+ nixpkgs,
+ ocaml,
+ flake-utils,
+ }:
+ flake-utils.lib.eachDefaultSystem (system: let
+ pkgs = import nixpkgs {
+ inherit system;
+ overlays = [
+ ocaml.overlays.default
+ (final: prev: {
+ # This ensures we consistently use one version of ocaml packages
+ ocamlPackages = prev.ocaml-ng.ocamlPackages_5_3;
+ ocaml = prev.ocaml-ng.ocamlPackages_5_3.ocaml;
+ })
+ ];
+ };
+ in {
+ devShells.default = pkgs.mkShell rec {
+ buildInputs =
+ nativeBuildInputs
+ ++ (with pkgs.ocamlPackages; [utop]);
+ nativeBuildInputs = with pkgs.ocamlPackages; [
+ pkgs.zig_0_14
+ pkgs.sqlite
+ pkgs.dune_3
+ pkgs.ocaml
+
+ pkgs.opam
+ findlib
+ ocamlformat
+ #
+ zarith
+ cmdliner
+ logs
+ alcotest
+ qcheck
+ qcheck-alcotest
+ landmarks
+
+ ctypes
+ ctypes-foreign
+ #
+ ocaml-lsp
+ eio_main
+ # http server
+ piaf
+ ];
+ };
+ });
+}