nix-config/hydra.nix
Greg Burd f3fd89af54
A fork of Misterio77 and his standard template.
Many thangs to the hard work and generous availability of:
git@github.com:Misterio77/nix-config.git
2023-09-15 10:53:38 -04:00

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