nix-config/hydra.nix
Greg Burd 86706b1fc7 wimpy-ified
inspired by wimpysworld nix-config
2023-09-25 14:05:07 -04:00

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