forked from auxolotl/labs
feat: pass through package dependencies via context
This commit is contained in:
parent
62bc2f4eee
commit
ea200d834e
|
@ -110,7 +110,7 @@ in
|
|||
// {
|
||||
inherit (package) meta;
|
||||
extras = {
|
||||
inherit package;
|
||||
inherit package context;
|
||||
phases = builtins.listToAttrs sorted.result;
|
||||
} // package.extras;
|
||||
};
|
||||
|
|
|
@ -89,14 +89,10 @@ in
|
|||
let
|
||||
dependencies = lib.attrs.selectOrThrow path collected;
|
||||
contexts = builtins.map (dependency: dependency.context or { }) dependencies;
|
||||
base = ctx // {
|
||||
target = builtins.concatStringsSep "." path;
|
||||
};
|
||||
result = lib.modules.run {
|
||||
modules = builtins.map
|
||||
(context: { config }: {
|
||||
config = context;
|
||||
})
|
||||
modules =
|
||||
builtins.map
|
||||
(context: { config = context; })
|
||||
contexts
|
||||
++ [
|
||||
{
|
||||
|
@ -116,10 +112,37 @@ in
|
|||
"target.only"
|
||||
"target.target"
|
||||
];
|
||||
writable = false;
|
||||
default.value = builtins.concatStringsSep "." path;
|
||||
};
|
||||
|
||||
deps = lib.options.create {
|
||||
description = "The collected dependencies.";
|
||||
writable = false;
|
||||
default.value = collected;
|
||||
type = lib.types.submodule {
|
||||
options = {
|
||||
build = {
|
||||
only = lib.options.create { type = lib.types.list.of lib'.types.package; };
|
||||
build = lib.options.create { type = lib.types.list.of lib'.types.package; };
|
||||
host = lib.options.create { type = lib.types.list.of lib'.types.package; };
|
||||
target = lib.options.create { type = lib.types.list.of lib'.types.package; };
|
||||
};
|
||||
host = {
|
||||
only = lib.options.create { type = lib.types.list.of lib'.types.package; };
|
||||
host = lib.options.create { type = lib.types.list.of lib'.types.package; };
|
||||
target = lib.options.create { type = lib.types.list.of lib'.types.package; };
|
||||
};
|
||||
target = {
|
||||
only = lib.options.create { type = lib.types.list.of lib'.types.package; };
|
||||
target = lib.options.create { type = lib.types.list.of lib'.types.package; };
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = base;
|
||||
config = ctx;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue