templates: inherit checks from _all_ templates

This commit is contained in:
Matt Sturgeon 2025-01-18 06:55:28 +00:00
parent 53bfadc2c2
commit e3938e9464
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299

View file

@ -25,7 +25,7 @@
args@{ args@{
inputs, inputs,
outputs, outputs,
sourceInfo, sourceInfo ? { },
}: }:
let let
outputs = args.outputs (inputs // { self = result; }); outputs = args.outputs (inputs // { self = result; });
@ -39,18 +39,21 @@
in in
result; result;
templateFlakeOutputs = callFlake { flakes = lib.mapAttrs (
inputs = { name: template:
inherit (inputs) flake-parts nixpkgs; callFlake {
nixvim = self; # Use inputs from our flake
}; inputs = {
# Import and read the `outputs` field of the template flake. inherit (inputs) flake-parts nixpkgs;
inherit (import ../templates/simple/flake.nix) outputs; nixvim = self;
sourceInfo = { }; };
}; # Use outputs from the template flake
inherit (import "${template.path}/flake.nix") outputs;
templateChecks = templateFlakeOutputs.checks.${system}; }
) self.templates;
in in
lib.concatMapAttrs (checkName: check: { "template-${checkName}" = check; }) templateChecks; lib.concatMapAttrs (name: flake: {
"template-${name}" = pkgs.linkFarm name flake.checks.${system};
}) flakes;
}; };
} }