Lets try hyrda again.

This commit is contained in:
Joseph Hanson 2024-04-05 13:08:02 -05:00
parent 9dfc28be1c
commit 344351cf3b
Signed by: jahanson
SSH key fingerprint: SHA256:vy6dKBECV522aPAwklFM3ReKAVB086rT3oWwiuiFG7o
2 changed files with 19 additions and 0 deletions

View file

@ -75,6 +75,7 @@
]; ];
in in
{ {
hydraJobs = import ./hydra.nix { inherit inputs outputs; };
nixosConfigurations = { nixosConfigurations = {
"durincore" = nixpkgs-unstable.lib.nixosSystem { "durincore" = nixpkgs-unstable.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";

18
hydra.nix Normal file
View file

@ -0,0 +1,18 @@
{ 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;
}