mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-11-23 17:20:31 +03:00
feat: ignore discoveredProjects
if projects
is defined
This commit is contained in:
parent
4214176e5a
commit
bd958e2566
@ -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
|
||||
// {
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user