diff --git a/flake.lock b/flake.lock index fd3b953f2..9ec67874e 100644 --- a/flake.lock +++ b/flake.lock @@ -5,11 +5,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1766482245, - "narHash": "sha256-EoXpMYCUPBjvjbjd2gOMqXJg4zAmVUW0t+sUeQwPbG4=", + "lastModified": 1769833275, + "narHash": "sha256-Qpn6/tkn6uVpCgF+XjMPZEzn6eWI0wnYik5mcNFV0HY=", "owner": "nix-ocaml", "repo": "nix-overlays", - "rev": "b0e1699cda4b43223a58d2d1964da80b727e009e", + "rev": "a747db22ad096b5ce4574983994ba0e201c2991e", "type": "github" }, "original": { @@ -20,17 +20,17 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1766427476, - "narHash": "sha256-KHgJHYGYuHUtJPBjczN0kFrWHmdfUXPa0Km6Yq/ELEE=", + "lastModified": 1769813739, + "narHash": "sha256-3VA9DOP24+RHTL7oRFBA6GAy/GkvAujI8L4yr57DMgw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6dd5b55337d892a8a441aaad31bf1a4165b453bc", + "rev": "16a3cae5c2487b1afa240e5f2c1811f172419558", "type": "github" }, "original": { "owner": "NixOS", "repo": "nixpkgs", - "rev": "6dd5b55337d892a8a441aaad31bf1a4165b453bc", + "rev": "16a3cae5c2487b1afa240e5f2c1811f172419558", "type": "github" } }, diff --git a/flake.nix b/flake.nix index db901e100..82e28211e 100644 --- a/flake.nix +++ b/flake.nix @@ -5,28 +5,43 @@ nixpkgs.url = "github:nix-ocaml/nix-overlays"; }; - outputs = { self, nixpkgs }: + outputs = + { self, nixpkgs }: let - forAllSystems = f: nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (system: - let - pkgs = nixpkgs.legacyPackages.${system}.extend (self: super: { - ocamlPackages = super.ocaml-ng.ocamlPackages_5_2; - }); - in - f pkgs); + forAllSystems = + f: + nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}.extend ( + self: super: { + ocamlPackages = super.ocaml-ng.ocamlPackages_5_4; + } + ); + in + f pkgs + ); in { - packages = forAllSystems (pkgs: + packages = forAllSystems ( + pkgs: let inherit (pkgs.ocamlPackages) - buildDunePackage melange merlin ppxlib_gt_0_37 reason; + buildDunePackage + melange + merlin + ppxlib_gt_0_37 + reason + ; packages = rec { reason-react-ppx = buildDunePackage { pname = "reason-react-ppx"; version = "n/a"; src = - let fs = pkgs.lib.fileset; in + let + fs = pkgs.lib.fileset; + in fs.toSource { root = ./.; fileset = fs.unions [ @@ -48,7 +63,9 @@ version = "n/a"; src = - let fs = pkgs.lib.fileset; in + let + fs = pkgs.lib.fileset; + in fs.toSource { root = ./.; fileset = fs.unions [ @@ -61,28 +78,47 @@ }; doCheck = true; - nativeBuildInputs = [ melange reason ]; - propagatedBuildInputs = [ melange reason-react-ppx ]; + nativeBuildInputs = [ + melange + reason + ]; + propagatedBuildInputs = [ + melange + reason-react-ppx + ]; }; }; in - packages // { default = packages.reason-react; }); + packages // { default = packages.reason-react; } + ); - devShells = forAllSystems (pkgs: + devShells = forAllSystems ( + pkgs: let - makeDevShell = { packages, release-mode ? false }: + makeDevShell = + { + packages, + release-mode ? false, + }: pkgs.mkShell { dontDetectOcamlConflicts = true; inputsFrom = pkgs.lib.attrValues packages; nativeBuildInputs = - with pkgs.ocamlPackages; [ ocamlformat pkgs.nodejs_latest ] - ++ pkgs.lib.optionals release-mode (with pkgs; [ - cacert - curl - ocamlPackages.dune-release - ocamlPackages.odoc - git - ]); + with pkgs.ocamlPackages; + [ + ocamlformat + pkgs.nodejs_24 + ] + ++ pkgs.lib.optionals release-mode ( + with pkgs; + [ + cacert + curl + ocamlPackages.dune-release + ocamlPackages.odoc + git + ] + ); propagatedBuildInputs = with pkgs.ocamlPackages; [ merlin ]; }; packages = self.packages.${pkgs.stdenv.hostPlatform.system}; @@ -93,6 +129,7 @@ inherit packages; release-mode = true; }; - }); + } + ); }; }