From 4d8e6420e5782a218842dd6ff141e99f4b332ebb Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Sun, 30 Apr 2023 17:20:37 -0400 Subject: [PATCH] map not lib.forEach --- flake.nix | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 68d9e5b..9a7b916 100644 --- a/flake.nix +++ b/flake.nix @@ -49,11 +49,12 @@ lib = unstable.lib; importAll = path: - lib.forEach ( + map + (module: (import module inputs)) + ( builtins.filter (file: lib.hasSuffix ".nix" file) (lib.filesystem.listFilesRecursive path) - ) - (module: (import module inputs)); + ); mkSystems = system: names: lib.genAttrs names ( @@ -104,14 +105,14 @@ }; } // builtins.listToAttrs ( - lib.forEach ( - builtins.filter (file: lib.hasSuffix ".nix" file) - (lib.filesystem.listFilesRecursive ./pkgs) - ) - (module: { + map (module: { name = lib.removeSuffix ".nix" (builtins.baseNameOf module); value = pkgs.callPackage module {}; }) + ( + builtins.filter (file: lib.hasSuffix ".nix" file) + (lib.filesystem.listFilesRecursive ./pkgs) + ) ); } );