1
0
Fork 0
nixos-config/overlays/file-tree.nix

15 lines
401 B
Nix
Raw Permalink Normal View History

2023-05-22 01:06:42 +00:00
final: _:
let
2023-02-11 14:14:51 +00:00
inherit (final) lib;
2023-05-22 01:06:42 +00:00
linkToPath = path: fileOrDir:
(if final.lib.types.path.check fileOrDir then [{
name = lib.concatStringsSep "/" path;
path = fileOrDir;
}] else
lib.concatLists
(lib.mapAttrsToList (dirName: linkToPath (path ++ [ dirName ]))
fileOrDir));
2022-03-08 01:42:46 +00:00
in {
2023-05-22 01:06:42 +00:00
recursiveLinkFarm = name: files: final.linkFarm name (linkToPath [ ] files);
2021-06-06 15:32:44 +00:00
}