export "dir" and "symlink" from pseudofiles package

This commit is contained in:
Daniel Barlow 2022-09-26 18:27:43 +01:00
parent 1c14bb63fa
commit 09a9dba963
5 changed files with 16 additions and 13 deletions

View file

@ -2,9 +2,7 @@
writeText
, lib
}:
filename : attrset :
let
inherit (lib.debug) traceSeqN;
inherit (lib.attrsets) mapAttrsToList;
visit = prefix: attrset:
let
@ -33,5 +31,8 @@ let
line)
attrset;
in builtins.concatStringsSep "\n" l;
res = (visit "" attrset);
in writeText filename res
in {
write = filename : attrset : writeText filename (visit "" attrset);
dir = contents: { type = "d"; inherit contents; };
symlink = target: { type = "s"; inherit target; };
}