2024-06-22 17:58:44 +00:00
|
|
|
{ config, lib }:
|
|
|
|
let
|
2024-06-13 17:22:57 +00:00
|
|
|
lib' = config.lib;
|
2024-06-22 17:58:44 +00:00
|
|
|
in
|
|
|
|
{
|
2024-06-09 13:27:35 +00:00
|
|
|
options = {
|
|
|
|
exports.packages = lib.options.create {
|
2024-06-15 09:35:37 +00:00
|
|
|
type = lib.types.attrs.of (lib'.types.raw);
|
2024-06-22 17:58:44 +00:00
|
|
|
default.value = { };
|
2024-06-09 13:27:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
exported.packages = lib.options.create {
|
2024-06-14 11:47:54 +00:00
|
|
|
type = lib.types.attrs.of (lib.types.attrs.of lib.types.derivation);
|
2024-06-22 17:58:44 +00:00
|
|
|
default.value = { };
|
2024-06-09 13:27:35 +00:00
|
|
|
};
|
|
|
|
};
|
2024-06-11 11:39:26 +00:00
|
|
|
|
|
|
|
config = {
|
2024-06-22 17:58:44 +00:00
|
|
|
exported.packages =
|
|
|
|
let
|
|
|
|
all = lib.attrs.generate lib'.systems.doubles.all (
|
|
|
|
system:
|
|
|
|
let
|
|
|
|
all = builtins.mapAttrs (
|
|
|
|
name: package:
|
|
|
|
let
|
2024-06-17 09:15:45 +00:00
|
|
|
result = lib'.packages.build package system system system;
|
2024-06-15 09:35:37 +00:00
|
|
|
in
|
2024-06-22 17:58:44 +00:00
|
|
|
result
|
|
|
|
) config.exports.packages;
|
2024-06-14 11:47:54 +00:00
|
|
|
|
2024-06-22 17:58:44 +00:00
|
|
|
available = lib.attrs.filter (name: package: builtins.elem system package.meta.platforms) all;
|
2024-06-15 09:35:37 +00:00
|
|
|
|
2024-06-22 17:58:44 +00:00
|
|
|
packages = builtins.mapAttrs (name: package: package.package) available;
|
|
|
|
in
|
2024-06-15 09:35:37 +00:00
|
|
|
packages
|
2024-06-22 17:58:44 +00:00
|
|
|
);
|
2024-06-14 11:47:54 +00:00
|
|
|
|
2024-06-22 17:58:44 +00:00
|
|
|
available = lib.attrs.filter (
|
|
|
|
system: packages: builtins.length (builtins.attrNames packages) != 0
|
|
|
|
) all;
|
|
|
|
in
|
2024-06-14 11:47:54 +00:00
|
|
|
available;
|
2024-06-11 11:39:26 +00:00
|
|
|
};
|
2024-06-09 13:27:35 +00:00
|
|
|
}
|