From 621e381519e1b5331aae6c848cc9cf8514ff944e Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Sat, 16 Nov 2024 13:00:51 +0900 Subject: [PATCH 1/3] fix(ocaml): Provide executables via nativeBuildInputs --- ocaml/flake.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ocaml/flake.nix b/ocaml/flake.nix index 68cb4ee..50e023b 100644 --- a/ocaml/flake.nix +++ b/ocaml/flake.nix @@ -47,10 +47,9 @@ src = self.outPath; # Uncomment if you need the executable of dream_eml during build - # preBuild = '' - # PATH="${ocamlPackages.dream}/bin:$PATH" - # export PATH - # ''; + # nativeBuildInputs = [ + # ocamlPackages.dream + # ]; buildInputs = with ocamlPackages; [ ocaml-syntax-shims ]; From 207a885e695592eadf831e70976490e5b8ce8a92 Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Sat, 16 Nov 2024 13:03:00 +0900 Subject: [PATCH 2/3] style(ocaml): Apply the overlay using extend for simplification --- ocaml/flake.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ocaml/flake.nix b/ocaml/flake.nix index 50e023b..41ecb19 100644 --- a/ocaml/flake.nix +++ b/ocaml/flake.nix @@ -23,10 +23,7 @@ nixpkgs.lib.genAttrs (import systems) ( system: let - pkgs = import nixpkgs { - inherit system; - overlays = [ ocaml-overlays.overlays.default ]; - }; + pkgs = nixpkgs.legacyPackages.${system}.extend ocaml-overlays.overlays.default; in f { inherit pkgs system; From b8f39c693e03f3f07e744903e028fa32584e5f2f Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Sat, 16 Nov 2024 13:05:41 +0900 Subject: [PATCH 3/3] docs(ocaml): Add a comment --- ocaml/flake.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ocaml/flake.nix b/ocaml/flake.nix index 41ecb19..be43dc1 100644 --- a/ocaml/flake.nix +++ b/ocaml/flake.nix @@ -27,6 +27,9 @@ in f { inherit pkgs system; + # You can set the OCaml version to a particular release. Also, you + # may have to pin some packages to a particular revision if the + # devshell fail to build. This should be resolved in the upstream. ocamlPackages = pkgs.ocaml-ng.ocamlPackages_latest; } );