summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix66
1 files changed, 66 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..899547c
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,66 @@
+{
+ inputs = {
+ flake-utils.url = "github:numtide/flake-utils";
+ nixpkgs.url = "github:nix-ocaml/nix-overlays";
+ };
+
+ outputs = {
+ self,
+ nixpkgs,
+ flake-utils,
+ }:
+ flake-utils.lib.eachDefaultSystem (system: let
+ pkgs = nixpkgs.legacyPackages.${system}.appendOverlays [
+ (self: super: {
+ ocamlPackages =
+ super.ocaml-ng.ocamlPackages_5_1.overrideScope'
+ (oself: osuper: {
+ pg_query = osuper.pg_query.overrideAttrs (prev: {
+ propagatedBuildInputs =
+ prev.propagatedBuildInputs
+ ++ [osuper.cmdliner];
+ });
+ });
+ })
+ ];
+
+ combattant = pkgs.ocamlPackages.buildDunePackage {
+ pname = "combattant";
+ version = "0.0.1";
+ src = ./.;
+ buildInputs = with pkgs.ocamlPackages; [
+ ppx_rapper
+ ppx_rapper_eio
+ yojson
+ eio_main
+ piaf
+ routes
+ caqti-dynload
+ caqti-driver-postgresql
+ caqti-driver-sqlite3
+ pkgs.sqlite
+ ppx_expect
+
+ logs
+ ];
+ };
+ in {
+ devShells.default = pkgs.mkShell rec {
+ nativeBuildInputs = with pkgs.ocamlPackages; [
+ dune_3
+ findlib
+ ocaml
+ ocaml-lsp
+ ocamlformat
+ pkgs.openjdk17
+ pkgs.sqlite
+ ];
+
+ buildInputs =
+ combattant.buildInputs
+ ++ (with pkgs.ocamlPackages; [utop]);
+ };
+
+ packages.default = combattant;
+ });
+}