diff options
author | polwex <polwex@sortug.com> | 2025-06-27 03:28:54 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-06-27 03:28:54 +0700 |
commit | ba350f124bab36766af6c71ba5e3dc17f33fb5ab (patch) | |
tree | 2b242e86cd8c30db058d110c5a4b7864f45f5be3 /flake.nix |
init
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 66 |
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; + }); +} |