diff --git a/src/default.nix b/src/default.nix index 2f449c2c..3ac4b7c8 100644 --- a/src/default.nix +++ b/src/default.nix @@ -609,7 +609,7 @@ in let generateImpureResolveScript = { source, - impureDiscoveredProjects, + impureProjects, }: let impureResolveScriptsList = l.listToAttrs @@ -621,7 +621,7 @@ in let "Name: ${project.name}; Subsystem: ${project.subsystem or "?"}; relPath: ${project.relPath}" (utils.makeTranslateScript {inherit project source;}) ) - impureDiscoveredProjects + impureProjects ); resolveImpureScript = @@ -653,20 +653,40 @@ in let sourceOverrides ? old: {}, inject ? {}, }: let - impureDiscoveredProjects = + # if projects are defined manually, ignore discoveredProjects + finalProjects = + if projects != {} + then let + projectsList = l.attrValues projects; + in + # skip discovery and just add required attributes to project list + l.forEach projectsList + (proj: + proj + // { + relPath = proj.relPath or ""; + translator = proj.translator or (l.head proj.translators); + dreamLockPath = + framework.functions.discoverers.getDreamLockPath + proj + (l.head projectsList); + }) + else discoveredProjects; + + impureProjects = l.filter (proj: framework.translators."${proj.translator}".type == "impure") - discoveredProjects; + finalProjects; resolveImpureScript = generateImpureResolveScript { - inherit impureDiscoveredProjects source; + inherit impureProjects source; }; translatedProjects = translateProjects { + discoveredProjects = finalProjects; inherit - discoveredProjects pname settings source @@ -702,7 +722,7 @@ in let or by resolving all impure projects by running the `resolveImpure` package ''; }) - impureDiscoveredProjects); + impureProjects); in realizedProjects // { diff --git a/src/modules/functions.discoverers/implementation.nix b/src/modules/functions.discoverers/implementation.nix index dea0d100..fc198267 100644 --- a/src/modules/functions.discoverers/implementation.nix +++ b/src/modules/functions.discoverers/implementation.nix @@ -3,7 +3,6 @@ dlib = config.dlib; discoverProjects = { - projects, source ? throw "Pass either `source` or `tree` to discoverProjects", tree ? dlib.prepareSourceTree {inherit source;}, settings ? [], @@ -24,7 +23,7 @@ in sorted; - allProjects = discoveredProjectsSorted ++ (l.attrValues projects); + allProjects = discoveredProjectsSorted; rootProject = l.head allProjects;