From 4f95a34a88f821dbe1f1070c2ae2407c09c2596e Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Sun, 9 Feb 2025 22:17:28 -0800 Subject: [PATCH] nix: remove nix-filter dependency (#874) --- flake.lock | 16 ---------------- flake.nix | 54 ++++++++++++++++++++++++++++-------------------------- 2 files changed, 28 insertions(+), 42 deletions(-) diff --git a/flake.lock b/flake.lock index 3d9358514..970254ed5 100644 --- a/flake.lock +++ b/flake.lock @@ -18,21 +18,6 @@ "type": "github" } }, - "nix-filter": { - "locked": { - "lastModified": 1710156097, - "narHash": "sha256-1Wvk8UP7PXdf8bCCaEoMnOT1qe5/Duqgj+rL8sRQsSM=", - "owner": "numtide", - "repo": "nix-filter", - "rev": "3342559a24e85fc164b295c3444e8a139924675b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "nix-filter", - "type": "github" - } - }, "nixpkgs": { "inputs": { "flake-utils": "flake-utils", @@ -70,7 +55,6 @@ }, "root": { "inputs": { - "nix-filter": "nix-filter", "nixpkgs": "nixpkgs" } }, diff --git a/flake.nix b/flake.nix index bb321eab8..55d6afa90 100644 --- a/flake.nix +++ b/flake.nix @@ -2,11 +2,10 @@ description = "Reason React Nix Flake"; inputs = { - nix-filter.url = "github:numtide/nix-filter"; nixpkgs.url = "github:nix-ocaml/nix-overlays"; }; - outputs = { self, nixpkgs, nix-filter }: + outputs = { self, nixpkgs }: let forAllSystems = f: nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed (system: let @@ -29,39 +28,42 @@ reason-react-ppx = buildDunePackage { pname = "reason-react-ppx"; version = "n/a"; - src = with nix-filter.lib; filter { - root = ./.; - include = [ - "dune-project" - "dune" - "reason-react-ppx.opam" - "reason-react.opam" - "ppx" - ]; - }; + + src = + let fs = pkgs.lib.fileset; in + fs.toSource { + root = ./.; + fileset = fs.unions [ + ./dune-project + ./dune + ./reason-react-ppx.opam + ./ppx + ]; + }; + # Due to a Reason version mismatch, the generated OCaml PPX diff # looks different doCheck = false; - checkInputs = [ ]; - checkPhase = "dune build @runtest -p reason-react,reason-react-ppx"; - nativeCheckInputs = [ reason merlin pkgs.jq ]; propagatedBuildInputs = [ ppxlib ]; }; reason-react = buildDunePackage { pname = "reason-react"; version = "n/a"; - src = with nix-filter.lib; filter { - root = ./.; - include = [ - "dune-project" - "dune" - "reason-react-ppx.opam" - "reason-react.opam" - "src" - "test" - ]; - }; + + src = + let fs = pkgs.lib.fileset; in + fs.toSource { + root = ./.; + fileset = fs.unions [ + ./dune-project + ./dune + ./reason-react.opam + ./src + ./test + ]; + }; + doCheck = true; nativeBuildInputs = [ melange reason ]; propagatedBuildInputs = [ melange reason-react-ppx ];