labs/tidepool/default.nix
Jake Hamilton 2f31813c88 feat: add support for platform specs (#15)
This PR adds a new way of declaring supported platforms for packages. Previously individual build, host, and target values needed to be set for a given platform combination. Now, a platform spec can be written to generate many platform combinations.

This allows for easy mapping of all possible systems with `@all`, linux systems with `@linux` or any other available alias of `lib.systems.doubles.<alias>` by using `@<alias>`. In addition, you can use `@build` and `@host` to lock either the host or target respectively to match the prior platform.

Reviewed-on: #15
2025-09-10 12:32:11 +00:00

53 lines
1,023 B
Nix

let
pins = import ./npins;
lib = import pins.lib;
foundation = import pins.foundation {
system = "i686-linux";
};
recursiveLibModule = {
__file__ = ./default.nix;
options = {
lib = lib.options.create {
type = lib.types.attrs.any;
default.value = { };
description = "An attribute set of values to be added to `lib`.";
apply = value: lib.extend (final: prev: lib.attrs.mergeRecursive lib value);
};
internal.packages.foundation = lib.options.create {
type = lib.types.attrs.of lib.types.derivation;
};
};
config = {
internal.packages.foundation = foundation;
};
};
new =
module:
let
set = lib.modules.run {
modules = [
./src/builders
./src/lib
./src/mirrors
recursiveLibModule
]
++ lib.lists.from.any module;
};
in
set.config
// {
inherit new;
inherit (set) extend;
};
in
new [
./src/packages
]