mirror of
https://github.com/Misterio77/Foundry.git
synced 2026-08-24 10:04:09 -05:00
Add themes to hydraJobs by reusing the themes flake's own hydraJobs output (inputs.themes.hydraJobs), so the sub-flake declares what it wants built. Surfaces allColorschemes and allWallpapers per system. Assisted-by: pi (opus-4.8)
23 lines
727 B
Nix
23 lines
727 B
Nix
{
|
|
inputs,
|
|
outputs,
|
|
}: let
|
|
inherit (inputs.nixpkgs) lib;
|
|
|
|
notBroken = pkg: !(pkg.meta.broken or false);
|
|
isDistributable = pkg: (pkg.meta.license or {redistributable = true;}).redistributable;
|
|
hasPlatform = sys: pkg: lib.elem sys (pkg.meta.platforms or [sys]);
|
|
filterValidPkgs = sys: pkgs:
|
|
lib.filterAttrs (_: pkg:
|
|
lib.isDerivation pkg
|
|
&& hasPlatform sys pkg
|
|
&& notBroken pkg
|
|
&& isDistributable pkg)
|
|
pkgs;
|
|
in {
|
|
pkgs = lib.mapAttrs filterValidPkgs outputs.packages;
|
|
themes = inputs.themes.hydraJobs;
|
|
hosts = lib.mapAttrs (_: cfg: cfg.config.system.build.toplevel) outputs.nixosConfigurations;
|
|
homes = lib.mapAttrs (_: cfg: cfg.activationPackage) outputs.homeConfigurations;
|
|
}
|