This repository has been archived on 2024-07-15. You can view files and clone it, but cannot push or open issues or pull requests.
nix-config/hydra.nix

18 lines
712 B
Nix
Raw Normal View History

2024-04-05 13:08:02 -05:00
{ inputs, outputs }:
let
2024-04-05 13:09:35 -05:00
inherit (inputs.nixpkgs-stable.lib) filterAttrs mapAttrs elem;
2024-04-05 13:08:02 -05:00
notBroken = pkg: !(pkg.meta.broken or false);
isDistributable = pkg:
(pkg.meta.license or { redistributable = true; }).redistributable;
hasPlatform = sys: pkg: elem sys (pkg.meta.platforms or [ ]);
filterValidPkgs = sys: pkgs:
filterAttrs
(_: pkg: hasPlatform sys pkg && notBroken pkg && isDistributable pkg) pkgs;
getCfg = _: cfg: cfg.config.system.build.toplevel;
getHomeCfg = _: cfg: cfg.config.home.activationPackage;
in {
# pkgs = mapAttrs filterValidPkgs outputs.packages;
hosts = mapAttrs getCfg outputs.nixosConfigurations;
# homes = mapAttrs getHomeCfg outputs.homeConfigurations;
}