From e18d3fb2804908fc00629e9139059d26a3ff4dcb Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Thu, 29 May 2025 15:17:45 +0100 Subject: [PATCH] flake/ci: add `ci.buildbot` output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- flake/ci.nix | 43 ++++++++++++++++++++++++++++++++++++++++++ flake/default.nix | 2 ++ flake/dev/devshell.nix | 1 + 3 files changed, 46 insertions(+) create mode 100644 flake/ci.nix diff --git a/flake/ci.nix b/flake/ci.nix new file mode 100644 index 00000000..69153c69 --- /dev/null +++ b/flake/ci.nix @@ -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; + }; + }; +} diff --git a/flake/default.nix b/flake/default.nix index 58db3e79..36875c31 100644 --- a/flake/default.nix +++ b/flake/default.nix @@ -8,6 +8,7 @@ { imports = [ ./flake-modules + ./ci.nix ./lib.nix ./legacy-packages.nix ./nixvim-configurations.nix @@ -31,6 +32,7 @@ # Specify which outputs are defined by which partitions partitionedAttrs = { + ci = "dev"; checks = "dev"; devShells = "dev"; formatter = "dev"; diff --git a/flake/dev/devshell.nix b/flake/dev/devshell.nix index 06930895..c12a050d 100644 --- a/flake/dev/devshell.nix +++ b/flake/dev/devshell.nix @@ -29,6 +29,7 @@ { name = "checks"; help = "Run all nixvim checks"; + # TODO: run tests from the `ci` flake output too? command = '' echo "=> Running all nixvim checks..."