module: sys.nix

This commit is contained in:
Emile Clark-Boman 2025-12-18 11:25:46 +10:00
parent f57e6f47d0
commit 452dcf99bb
2 changed files with 41 additions and 35 deletions

37
nib/sys.nix Normal file
View file

@ -0,0 +1,37 @@
{
systems,
nib,
...
}: let
std = nib.std;
in {
# === 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.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.genAttrs systems (
system: f system (pkgsFor system) (upkgsFor system)
);
};
}