mirror of
https://gitlab.com/TECHNOFAB/nix-gitlab-ci.git
synced 2026-06-19 00:29:25 +02:00
Add `checks` option and `config.autoChecks` to auto-generate a CI job for each flake check derivation. Auto-generated jobs go through `mkJobPatched` for proper Nix setup, cache, and environment handling. The `checks` option is automatically wired to `config.checks` in flake-parts. System is inferred from `pkgs.system` and set via the new `system` option. User-defined jobs with the same name always take precedence. New tests cover both flake-parts and direct API entry points. MT-14138
33 lines
760 B
Nix
33 lines
760 B
Nix
{
|
|
outputs = {
|
|
flake-parts,
|
|
systems,
|
|
...
|
|
} @ inputs:
|
|
flake-parts.lib.mkFlake {inherit inputs;} {
|
|
imports = [
|
|
"@repo_path@/lib/flakeModule.nix"
|
|
];
|
|
systems = import systems;
|
|
flake = {};
|
|
perSystem = {pkgs, ...}: let
|
|
fakeCheck = pkgs.runCommand "fake-check" {} "touch $out";
|
|
in {
|
|
checks = {
|
|
my-check = fakeCheck;
|
|
};
|
|
ci = {
|
|
config.autoChecks.enable = true;
|
|
pipelines.default = {
|
|
stages = ["test"];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
|
systems.url = "github:nix-systems/default-linux";
|
|
};
|
|
}
|