first commit

This commit is contained in:
2026-03-10 16:57:35 +01:00
commit 31c7ad6454
14 changed files with 395 additions and 0 deletions

18
rI.nix Normal file
View File

@@ -0,0 +1,18 @@
{ lib }:
let
inherit (lib) hasSuffix;
inherit (builtins) concatMap isPath filter readFileType;
expandIfFolder = elem:
if !isPath elem || readFileType elem != "directory"
then [ elem ]
else lib.filesystem.listFilesRecursive elem;
in
list: filter
# Filter out any path that doesn't look like `*.nix`. Don't forget to use
# toString to prevent copying paths to the store unnecessarily
(elem: !isPath elem || hasSuffix ".nix" (toString elem))
# Expand any folder to all the files within it.
(concatMap expandIfFolder list)