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
2024-04-05 13:09:35 -05:00

18 lines
No EOL
712 B
Nix

{ inputs, outputs }:
let
inherit (inputs.nixpkgs-stable.lib) filterAttrs mapAttrs elem;
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;
}