diff --git a/lix/nix/flake.cc b/lix/nix/flake.cc index 52db3e4b1..ea8550a9b 100644 --- a/lix/nix/flake.cc +++ b/lix/nix/flake.cc @@ -469,11 +469,6 @@ struct CmdFlakeCheck : FlakeCommand if (!v.isLambda()) { throw Error("overlay is not a function, but %s instead", showType(v)); } - auto body = v.lambda().fun->body->try_cast(); - if (!body) - throw Error("overlay is not a function with two arguments, but only takes one"); - if (body->body->try_cast()) - throw Error("overlay is not a function with two arguments, but takes more than two"); // FIXME: if we have a 'nixpkgs' input, use it to // evaluate the overlay. } catch (Error & e) { diff --git a/tests/functional2/flakes/test_check.py b/tests/functional2/flakes/test_check.py index 756518720..f5359165e 100644 --- a/tests/functional2/flakes/test_check.py +++ b/tests/functional2/flakes/test_check.py @@ -34,34 +34,6 @@ def test_check_overlay_args_good(nix: Nix, files: Path): nix.nix(["flake", "check", str(files)]).run().ok() -@with_files( - make_flake("""{ - outputs = { self }: { - overlay = one: two: three: {}; - }; - }""") -) -def test_check_overlay_too_many_args(nix: Nix, files: Path): - assert ( - "error: overlay is not a function with two arguments, but takes more than two" - in nix.nix(["flake", "check", str(files)]).run().expect(1).stderr_s - ) - - -@with_files( - make_flake("""{ - outputs = { self }: { - overlay = one: {}; - }; - }""") -) -def test_check_overlay_not_enough_args(nix: Nix, files: Path): - assert ( - "error: overlay is not a function with two arguments, but only takes one" - in nix.nix(["flake", "check", str(files)]).run().expect(1).stderr_s - ) - - @with_files( make_flake("""{ outputs = { self, ... }: {