From 942a008e28cdd49ef58534a522364db8dcbb6237 Mon Sep 17 00:00:00 2001 From: figsoda Date: Mon, 29 May 2023 13:39:48 -0400 Subject: [PATCH 1/3] perInput: Make the default lazier --- modules/transposition.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/transposition.nix b/modules/transposition.nix index 5ddfcd0..2cd5c52 100644 --- a/modules/transposition.nix +++ b/modules/transposition.nix @@ -65,10 +65,7 @@ in system: flake: mapAttrs (attrName: attrConfig: flake.${attrName}.${system}) - (filterAttrs - (attrName: attrConfig: flake?${attrName}.${system}) - config.transposition - ); + config.transposition; perSystem = { ... }: { options = From 6ae737878e164dcca72235196be1c0829aecbd79 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 30 May 2023 15:31:19 +0200 Subject: [PATCH 2/3] 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"; From 6a6d2511659da22f1cdb1475322998c7ea8ad126 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Tue, 30 May 2023 15:43:56 +0200 Subject: [PATCH 3/3] Update ChangeLog --- ChangeLog.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ChangeLog.md b/ChangeLog.md index 02182ef..6103b3b 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,26 @@ + +# 2023-05-30 + + - Fix a strictness issue in `perInput`, affecting `inputs'`, `self'`. + This has caused infinite recursions and potentially performance issues since + the introduction of these module arguments. + +# 2023-05-08 + + - Add [`importApply`](https://flake.parts/define-module-in-separate-file.html?highlight=importApply#importApply) for bringing variables from the flake scope into module files. + + - Add `mkDeferredModuleOption` as a generic name for the implementation of `mkPerSystemOption`. + +# 2023-03-26 + + - Add preliminary support for `disabledModules` for modules exposed via the importable `flakeModules` module. + This requires a Nixpkgs of 2023-03-09 or newer. + +# 2023-01-05 + + - Add importable `easyOverlay` module for defining an overlay "easily" by reusing `perSystem`. + This is not for consuming overlays. + # 2022-12-25 - Added a new `flake.flakeModules` option so a flake can expose a module