From d16bcb693db18b8ab2508cef6400ce1219dac833 Mon Sep 17 00:00:00 2001 From: Alejandro Soto Date: Fri, 2 Aug 2024 14:25:52 -0600 Subject: pkgs/lib: refactor out of util/ --- util/importAll.nix | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 util/importAll.nix (limited to 'util/importAll.nix') diff --git a/util/importAll.nix b/util/importAll.nix deleted file mode 100644 index cc18640..0000000 --- a/util/importAll.nix +++ /dev/null @@ -1,17 +0,0 @@ -lib: -{ root, exclude ? [ ] }: -with builtins; with lib; - -# http://chriswarbo.net/projects/nixos/useful_hacks.html -let - basename = removeSuffix ".nix"; - - isMatch = name: type: (hasSuffix ".nix" name || type == "directory") - && ! elem name (map basename exclude); - - entry = name: _: { - name = basename name; - value = import (root + "/${name}"); - }; -in -mapAttrs' entry (filterAttrs isMatch (readDir root)) -- cgit v1.2.3