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
No EOL
705 B
Nix

{ inputs, outputs }:
let
inherit (inputs.nixpkgs.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;
}