From e3f5704afc0773ad7be13926461005624c821479 Mon Sep 17 00:00:00 2001 From: chn Date: Thu, 27 Jul 2023 22:53:29 +0800 Subject: [PATCH] fix --- local/lib/default.nix | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/local/lib/default.nix b/local/lib/default.nix index 853beaa3..b9f13ca5 100644 --- a/local/lib/default.nix +++ b/local/lib/default.nix @@ -9,17 +9,16 @@ lib: # inputs: { environment.systemPackages = [ pkgs.hello ]; } # The second one would failed to evaluate because nixpkgs would not pass pkgs to it. # So that we wrote a wrapper to make it always works like the first one. - mkModules = moduleList: { pkgs, ... }@inputs: - { - imports = builtins.map - ( - let handle = module: - if ( builtins.typeOf module ) == "path" then handle import module - else if ( builtins.typeOf module ) == "lambda" then module inputs - else module; - in handle - ) moduleList; - }; + mkModules = moduleList: + (builtins.map + ( + let handle = module: + if ( builtins.typeOf module ) == "path" then (handle (import module)) + else if ( builtins.typeOf module ) == "lambda" then ({ pkgs, utils, ... }@inputs: (module inputs)) + else module; + in handle + ) + moduleList); # from: https://github.com/NixOS/nix/issues/3759 stripeTabs = text: