mirror of
https://github.com/gburd/nix-config.git
synced 2024-11-20 10:36:25 +00:00
14 lines
459 B
Nix
14 lines
459 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: pkgs: filterAttrs (_: pkg: hasPlatform sys pkg && notBroken pkg) pkgs;
|
||
|
getCfg = _: cfg: cfg.config.system.build.toplevel;
|
||
|
in
|
||
|
{
|
||
|
pkgs = mapAttrs filterValidPkgs outputs.packages;
|
||
|
hosts = mapAttrs getCfg outputs.nixosConfigurations;
|
||
|
}
|