From df9f1a1bd0479a05e09f2c64eca333efbeb241be Mon Sep 17 00:00:00 2001 From: Dusk Banks Date: Wed, 19 Apr 2023 01:32:18 +0000 Subject: [PATCH] moduleWithSystem: Clarify local variable names (cherry picked from commit e0baa4cdbaafef33c9f268bec300f4c4f1b9d26a) --- modules/moduleWithSystem.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/moduleWithSystem.nix b/modules/moduleWithSystem.nix index bd739cc..e4d397f 100644 --- a/modules/moduleWithSystem.nix +++ b/modules/moduleWithSystem.nix @@ -13,19 +13,19 @@ "moduleWithSystem: Could not determine the `system` parameter for this module set evaluation." ); - allArgs = withSystem system (args: args); + allPerSystemArgs = withSystem system (args: args); - lazyArgsPerParameter = f: builtins.mapAttrs - (k: v: allArgs.${k} or (throw "moduleWithSystem: per-system argument `${k}` does not exist.")) + lazyPerSystemArgsPerParameter = f: builtins.mapAttrs + (k: v: allPerSystemArgs.${k} or (throw "moduleWithSystem: per-system argument `${k}` does not exist.")) (builtins.functionArgs f); # Use reflection to make the call lazy in the argument. # Restricts args to the ones declared. - callLazily = f: a: f (lazyArgsPerParameter f); + callLazily = f: a: f (lazyPerSystemArgsPerParameter f); in { imports = [ - (callLazily module allArgs) + (callLazily module allPerSystemArgs) ]; }; };