Ostara rework - extend domainMerge

This commit is contained in:
kat witch 2021-08-11 21:15:35 +01:00
parent a9b7332d3c
commit 2c512aeb7b
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
10 changed files with 34 additions and 22 deletions

View file

@ -1,10 +1,9 @@
{ lib }: { folder, defaultFile ? "default.nix" }: with lib; let
folderNames = [ (../../depot + "/${folder}") (../../depot/trusted + "/${folder}") ];
{ lib }: { folder, defaultFile ? "default.nix", folderPaths ? [ (../../depot + "/${folder}") (../../depot/trusted + "/${folder}") ] }: with lib; let
defaultFileFinal = if (defaultFile == "default.nix" && folder == "hosts") then
"meta.nix"
else defaultFile;
folderModLists = map (folderName: modList {
modulesDir = folderName;
folderModLists = map (folderPath: modList {
modulesDir = folderPath;
defaultFile = defaultFileFinal;
}) (filter builtins.pathExists folderNames);
}) (filter builtins.pathExists folderPaths);
in foldl modListMerge { } folderModLists