lib: add misc functions from old rewrite attempt

This commit is contained in:
Infinidoge 2023-08-25 16:38:46 -04:00
parent 93885267e9
commit cb43a8341a

View file

@ -27,6 +27,11 @@ rec {
replaceStrings
[ "." ] [ "" ]
(sanitizeDerivationName (removePrefix "/" name));
mapGenAttrs = list: func: attrs:
lib.genAttrs list (name: func (if builtins.typeOf attrs == "lambda" then attrs name else attrs));
dirsOf = dir: lib.attrNames (lib.filterAttrs (file: type: type == "directory") (builtins.readDir dir));
} // (
import ./digga.nix { inherit lib; }
) // (