Add more custom libs

This commit is contained in:
SebastianStork 2025-10-13 14:12:18 +02:00
parent f084e91ec0
commit 3acd35c7b2
5 changed files with 22 additions and 27 deletions

View file

@ -4,4 +4,12 @@ lib: {
subdomainOf = domain: domain |> lib.splitString "." |> lib.head;
rootDomainOf = domain: domain |> lib.splitString "." |> lib.tail |> lib.concatStringsSep ".";
listNixFilesRecursive =
dir: dir |> lib.filesystem.listFilesRecursive |> lib.filter (lib.hasSuffix ".nix");
listDirectories =
path: path |> builtins.readDir |> lib.filterAttrs (_: type: type == "directory") |> lib.attrNames;
genAttrs = f: names: lib.genAttrs names f;
}