nix-config/hydra.nix

14 lines
448 B
Nix
Raw Normal View History

{ 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;
}