fix: sourceOverrides not applied to path sources

This commit is contained in:
DavHau 2022-02-23 12:15:27 +07:00
parent 59754b406d
commit 3e19b05b9a
2 changed files with 11 additions and 8 deletions

View File

@ -151,6 +151,7 @@ let
dreamLock,
fetcher ? null,
extract ? false,
sourceOverrides ? oldSources: {},
}@args:
let
# if dream lock is a file, read and parse it
@ -163,6 +164,7 @@ let
args.fetcher;
fetched = fetcher rec {
inherit sourceOverrides;
defaultPackage = dreamLock._generic.defaultPackage;
defaultPackageVersion = dreamLock._generic.packages."${defaultPackage}";
sources = dreamLock'.sources;
@ -261,11 +263,6 @@ let
dreamLockInterface = (utils.readDreamLock { inherit dreamLock; }).interface;
fetchedSources =
lib.recursiveUpdate
args.fetchedSources
(sourceOverrides args.fetchedSources);
produceDerivation = name: pkg:
utils.applyOverridesToPackage {
inherit pkg;
@ -411,7 +408,7 @@ let
fetcher;
fetchedSources = (fetchSources {
inherit dreamLock;
inherit dreamLock sourceOverrides;
fetcher = fetcher';
}).fetchedSources;

View File

@ -10,6 +10,7 @@
# sources attrset from dream lock
defaultPackage,
defaultPackageVersion,
sourceOverrides,
sources,
...
}:
@ -31,7 +32,7 @@ let
source.path
# assume path relative to main package source
else
"${fetchedSources."${defaultPackage}"."${defaultPackageVersion}"}/${source.path}"
"${overriddenSources."${defaultPackage}"."${defaultPackageVersion}"}/${source.path}"
else if fetchers.fetchers ? "${source.type}" then
fetchSource {
source = source // {
@ -43,8 +44,13 @@ let
versions)
sources;
overriddenSources =
lib.recursiveUpdate
fetchedSources
(sourceOverrides fetchedSources);
in
{
# attrset: pname -> path of downloaded source
inherit fetchedSources;
fetchedSources = overriddenSources;
}