mirror of
https://github.com/gburd/nix-config.git
synced 2024-11-14 00:26:24 +00:00
13 lines
448 B
Nix
13 lines
448 B
Nix
{ inputs, outputs }:
|
|
let
|
|
inherit (inputs.nixpkgs.lib) filterAttrs mapAttrs elem;
|
|
|
|
notBroken = pkg: !(pkg.meta.broken or false);
|
|
hasPlatform = sys: pkg: elem sys (pkg.meta.platforms or [ ]);
|
|
filterValidPkgs = sys: filterAttrs (_: pkg: hasPlatform sys pkg && notBroken pkg);
|
|
getCfg = _: cfg: cfg.config.system.build.toplevel;
|
|
in
|
|
{
|
|
pkgs = mapAttrs filterValidPkgs outputs.packages;
|
|
hosts = mapAttrs getCfg outputs.nixosConfigurations;
|
|
}
|