From 21da33cdd44db5c2937bf7ebdc8ab3e68370d554 Mon Sep 17 00:00:00 2001 From: 0xda157 Date: Wed, 3 Dec 2025 13:46:54 -0800 Subject: [PATCH] flake: add remaining drvs to ci.buildbot Closes: https://github.com/nix-community/stylix/issues/2056 (cherry picked from commit 7420f203cac43514d6c9611b13c61fc169e7e37a) --- flake/dev/dev-shell.nix | 2 + flake/dev/pre-commit.nix | 2 + .../public-and-dev-version-consistency.nix | 67 ++++++++++--------- 3 files changed, 39 insertions(+), 32 deletions(-) diff --git a/flake/dev/dev-shell.nix b/flake/dev/dev-shell.nix index 53ff15f1..df6c4244 100644 --- a/flake/dev/dev-shell.nix +++ b/flake/dev/dev-shell.nix @@ -39,6 +39,8 @@ ''; in { + ci.buildbot = { inherit (config) devShells; }; + devShells = { default = pkgs.mkShell { # Install git-hooks when activating the shell diff --git a/flake/dev/pre-commit.nix b/flake/dev/pre-commit.nix index a2d21568..8717ef4c 100644 --- a/flake/dev/pre-commit.nix +++ b/flake/dev/pre-commit.nix @@ -5,6 +5,8 @@ perSystem = { config, ... }: { + ci.buildbot = { inherit (config.checks) pre-commit; }; + pre-commit = { check.enable = true; diff --git a/flake/dev/public-and-dev-version-consistency.nix b/flake/dev/public-and-dev-version-consistency.nix index 6cad4644..8ae2d1fe 100644 --- a/flake/dev/public-and-dev-version-consistency.nix +++ b/flake/dev/public-and-dev-version-consistency.nix @@ -1,41 +1,44 @@ { inputs, ... }: { perSystem = - { lib, pkgs, ... }: { - checks = lib.mkMerge ( - map - ( - input: - let - name = "${input}-and-dev-${input}-version-consistency"; - in - { - ${name} = - let - dev = inputs."dev-${input}".narHash; - public = inputs.${input}.narHash; - in - pkgs.runCommand name { } '' - if [ "${public}" != "${dev}" ]; then - printf \ - 'inconsistent ${input} (%s) and dev-${input} (%s) versions\n' \ - "${public}" \ - "${dev}" \ - >&2 + lib, + pkgs, + system, + ... + }: + let + checks = lib.genAttrs' [ "flake-parts" "nixpkgs" "systems" ] ( + input: + let + name = "${input}-and-dev-${input}-version-consistency"; + in + lib.nameValuePair name ( + let + dev = inputs."dev-${input}".narHash; + public = inputs.${input}.narHash; + in + pkgs.runCommand name { } '' + if [ "${public}" != "${dev}" ]; then + printf \ + 'inconsistent ${input} (%s) and dev-${input} (%s) versions\n' \ + "${public}" \ + "${dev}" \ + >&2 - exit 1 - fi + exit 1 + fi - mkdir "$out" - ''; - } - ) - [ - "flake-parts" - "nixpkgs" - "systems" - ] + mkdir "$out" + '' + ) ); + in + { + inherit checks; + + ci.buildbot = lib.mkIf (system == "x86_64-linux") { + public-and-dev-version-consistency = pkgs.linkFarm "public-and-dev-version-consistency" checks; + }; }; }