flake/ci: add ci.buildbot output

Adds top-level and per-system `ci.buildbot` option for defining tests to
build on buildbot.

These are exposed as the `ci.buildbot.«system»` flake output.
This commit is contained in:
Matt Sturgeon 2025-05-29 15:17:45 +01:00
parent 8b3a69cfea
commit e18d3fb280
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
3 changed files with 46 additions and 0 deletions

43
flake/ci.nix Normal file
View file

@ -0,0 +1,43 @@
{ lib, config, ... }:
let
inherit (lib)
mapAttrs
types
;
buildbotOpt = lib.mkOption {
type = types.lazyAttrsOf types.package;
default = { };
description = ''
A set of tests for [buildbot] to run.
[buildbot]: https://buildbot.nix-community.org
'';
};
in
{
perSystem = {
# Declare per-system CI options
options.ci = {
buildbot = buildbotOpt;
};
};
flake = {
# Declare top-level CI options
options.ci = {
buildbot = lib.mkOption {
type = types.lazyAttrsOf buildbotOpt.type;
default = { };
description = ''
See `perSystem.ci.buildbot` for description and examples.
'';
};
};
# Transpose per-system CI outputs to the top-level
config.ci = {
buildbot = mapAttrs (_: sysCfg: sysCfg.ci.buildbot) config.allSystems;
};
};
}

View file

@ -8,6 +8,7 @@
{ {
imports = [ imports = [
./flake-modules ./flake-modules
./ci.nix
./lib.nix ./lib.nix
./legacy-packages.nix ./legacy-packages.nix
./nixvim-configurations.nix ./nixvim-configurations.nix
@ -31,6 +32,7 @@
# Specify which outputs are defined by which partitions # Specify which outputs are defined by which partitions
partitionedAttrs = { partitionedAttrs = {
ci = "dev";
checks = "dev"; checks = "dev";
devShells = "dev"; devShells = "dev";
formatter = "dev"; formatter = "dev";

View file

@ -29,6 +29,7 @@
{ {
name = "checks"; name = "checks";
help = "Run all nixvim checks"; help = "Run all nixvim checks";
# TODO: run tests from the `ci` flake output too?
command = '' command = ''
echo "=> Running all nixvim checks..." echo "=> Running all nixvim checks..."