2024-06-05 02:04:40 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
config,
|
|
|
|
}: let
|
|
|
|
options = {
|
|
|
|
packages = lib.options.create {
|
|
|
|
default.value = {};
|
|
|
|
|
|
|
|
type = lib.types.attrs.of lib.types.package;
|
|
|
|
};
|
2024-06-05 22:16:52 +00:00
|
|
|
|
|
|
|
extras = lib.options.create {
|
|
|
|
default.value = {};
|
|
|
|
type = lib.types.attrs.any;
|
|
|
|
};
|
2024-06-05 02:04:40 +00:00
|
|
|
};
|
|
|
|
in {
|
|
|
|
options = {
|
|
|
|
exports = {
|
2024-06-05 22:16:52 +00:00
|
|
|
inherit (options) packages extras;
|
2024-06-05 02:04:40 +00:00
|
|
|
|
|
|
|
resolved = {
|
2024-06-05 22:16:52 +00:00
|
|
|
inherit (options) packages extras;
|
2024-06-05 02:04:40 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
2024-06-05 22:16:52 +00:00
|
|
|
exports.resolved = {
|
|
|
|
packages =
|
|
|
|
builtins.mapAttrs (
|
|
|
|
name: value:
|
|
|
|
lib.attrs.filter
|
|
|
|
(
|
|
|
|
name: value:
|
|
|
|
if value ? meta && value.meta ? platforms
|
|
|
|
then builtins.elem config.aux.system value.meta.platforms
|
|
|
|
else true
|
|
|
|
)
|
|
|
|
value
|
|
|
|
)
|
|
|
|
config.exports.packages;
|
|
|
|
|
|
|
|
extras = config.exports.extras;
|
|
|
|
};
|
2024-06-05 02:04:40 +00:00
|
|
|
};
|
|
|
|
}
|