From 6ae737878e164dcca72235196be1c0829aecbd79 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 30 May 2023 15:31:19 +0200 Subject: [PATCH] Test that packages is not strict in devShell Discovered and solved by figsoda, see https://github.com/hercules-ci/flake-parts/issues/160 --- dev/tests/eval-tests.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dev/tests/eval-tests.nix b/dev/tests/eval-tests.nix index e0dedae..437ee1a 100644 --- a/dev/tests/eval-tests.nix +++ b/dev/tests/eval-tests.nix @@ -35,6 +35,18 @@ rec { }; }; + packagesNonStrictInDevShells = mkFlake + { inputs.self = packagesNonStrictInDevShells; /* approximation */ } + { + systems = [ "a" "b" ]; + perSystem = { system, self', ... }: { + packages.hello = pkg system "hello"; + packages.default = self'.packages.hello; + devShells = throw "can't be strict in perSystem.devShells!"; + }; + flake.devShells = throw "can't be strict in devShells!"; + }; + easyOverlay = mkFlake { inputs.self = { }; } { @@ -148,6 +160,8 @@ rec { assert flakeModulesDisable.test123 == "option123"; + assert packagesNonStrictInDevShells.packages.a.default == pkg "a" "hello"; + ok; result = runTests "ok";