nt/nib/default.nix
2025-12-14 10:13:04 +10:00

49 lines
1.2 KiB
Nix

{systems, ...}: let
std = import ./std {};
parse = import ./parse {
attrs = std.attrs;
lists = std.lists;
result = std.result;
};
in
std.attrs.mergeAttrsList [
# submodule content is accessible first by submodule name
# then by the name of the content (ie self.submodule.myFunc)
{inherit parse;}
# submodule is included directly to this module (ie self.myFunc)
std
# this module
{
# === External Functions ===
withPkgs = repo: config: system:
import repo {
inherit system;
}
// config;
mkSys = input: let
# function taking a system as argument
pkgsFor = input.pkgs;
in {
inherit pkgsFor;
forAllSystems = f:
std.attrs.genAttrs systems (
system: f system (pkgsFor system)
);
};
mkUSys = input: let
# functions taking a system as argument
pkgsFor = input.pkgs;
upkgsFor = input.upkgs;
in {
inherit pkgsFor upkgsFor;
forAllSystems = f:
std.attrs.genAttrs systems (
system: f system (pkgsFor system) (upkgsFor system)
);
};
}
]