mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-12-24 15:01:56 +03:00
automatically add dreamLockPath to discovered projects
This commit is contained in:
parent
017b2e0144
commit
b1b80111d2
@ -521,19 +521,6 @@ let
|
||||
in
|
||||
dreamLockExists && dreamLockValid;
|
||||
|
||||
getDreamLockPath = project:
|
||||
let
|
||||
root =
|
||||
if config.projectRoot == null then
|
||||
"/projectRoot_not_set_in_dream2nix_config"
|
||||
else
|
||||
config.projectRoot;
|
||||
in
|
||||
"${root}/"
|
||||
+
|
||||
(dlib.sanitizeRelativePath
|
||||
"${config.packagesDir}/${pname}/${project.relPath}/dream-lock.json");
|
||||
|
||||
getProjectKey = project:
|
||||
"${project.name}_|_${project.subsystem}_|_${project.relPath}";
|
||||
|
||||
@ -541,8 +528,7 @@ let
|
||||
projectsList =
|
||||
l.map
|
||||
(project: project // (let self = rec {
|
||||
dreamLockPath = getDreamLockPath project;
|
||||
dreamLock = dlib.readDreamLock dreamLockPath;
|
||||
dreamLock = dlib.readDreamLock project.dreamLockPath;
|
||||
impure = isImpure project translator;
|
||||
key = getProjectKey project;
|
||||
resolved = isResolved self;
|
||||
@ -752,4 +738,8 @@ in
|
||||
updaters
|
||||
utils
|
||||
;
|
||||
|
||||
inherit (dlib)
|
||||
discoverers
|
||||
;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
config,
|
||||
dlib,
|
||||
lib,
|
||||
}:
|
||||
@ -19,13 +20,35 @@ let
|
||||
tree ? dlib.prepareSourceTree { inherit source; },
|
||||
settings ? [],
|
||||
}: let
|
||||
discovered =
|
||||
discoveredProjects =
|
||||
l.flatten
|
||||
(l.map
|
||||
(discoverer: discoverer.discover { inherit tree; })
|
||||
allDiscoverers);
|
||||
|
||||
rootProjectName = l.head discoveredProjects;
|
||||
|
||||
projectsExtended = l.forEach discoveredProjects
|
||||
(proj: proj
|
||||
// {
|
||||
translator = l.head proj.translators;
|
||||
dreamLockPath = getDreamLockPath proj rootProjectName;
|
||||
});
|
||||
in
|
||||
applyProjectSettings discovered settings;
|
||||
applyProjectSettings projectsExtended settings;
|
||||
|
||||
getDreamLockPath = project: rootProject:
|
||||
let
|
||||
root =
|
||||
if config.projectRoot == null then
|
||||
"."
|
||||
else
|
||||
config.projectRoot;
|
||||
in
|
||||
"${root}/"
|
||||
+
|
||||
(dlib.sanitizeRelativePath
|
||||
"${config.packagesDir}/${rootProject.name}/${project.relPath}/dream-lock.json");
|
||||
|
||||
applyProjectSettings = projects: settingsList:
|
||||
let
|
||||
|
Loading…
Reference in New Issue
Block a user