mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
13 lines
421 B
Nix
13 lines
421 B
Nix
{ lib }: { folder, defaultFile ? "default.nix", folderPaths ? [ ] }: with lib; let
|
|
defaultFileFinal =
|
|
if (defaultFile == "default.nix" && folder == "hosts") then
|
|
"nixos.nix"
|
|
else defaultFile;
|
|
folderModLists = map
|
|
(folderPath: modList {
|
|
modulesDir = folderPath;
|
|
defaultFile = defaultFileFinal;
|
|
})
|
|
(filter builtins.pathExists folderPaths);
|
|
in
|
|
foldl modListMerge { } folderModLists
|