flake: add remaining drvs to ci.buildbot (#2060)
Some checks are pending
Label Merge Conflicts / conflicts (push) Waiting to run
Documentation / docs (push) Waiting to run

Link: https://github.com/nix-community/stylix/pull/2060

Co-authored-by: Matt Sturgeon <matt@sturgeon.me.uk>
Reviewed-by: Matt Sturgeon <matt@sturgeon.me.uk>
Reviewed-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
This commit is contained in:
NAHO 2025-12-24 20:03:46 +01:00 committed by GitHub
commit 551df12ee3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 39 additions and 92 deletions

View file

@ -1,60 +0,0 @@
---
name: Check
on:
push:
branches:
- master
- release-**
pull_request:
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
check:
name: ${{ matrix.name }}
runs-on: ${{ matrix.runs-on }}
# https://docs.github.com/en/actions/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job#choosing-github-hosted-runners
strategy:
matrix:
include:
- name: aarch64-linux
runs-on: ubuntu-24.04-arm
- name: aarch64-darwin
runs-on: macos-15
- name: x86_64-linux
runs-on: ubuntu-24.04
- name: x86_64-darwin
runs-on: macos-15-intel
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
# TODO: Lock this Action to a release tag once commit [1] ("fix: relocate
# TMPDIR to /mnt to improve Nix installer compatibility") is part of a
# release, resolving [2] ("does not work with cachix install nix action").
#
# [1]: https://github.com/wimpysworld/nothing-but-nix/pull/25
# [2]: https://github.com/wimpysworld/nothing-but-nix/issues/24
- uses: wimpysworld/nothing-but-nix@10c936d9e46521bf923f75458e0cbd4fa309300d # yamllint disable-line rule:line-length
if: runner.os == 'Linux'
with:
hatchet-protocol: rampage
- uses: cachix/install-nix-action@v31
- uses: cachix/cachix-action@v16
with:
name: nix-community
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
continue-on-error: true
- run: nix develop --command stylix-check --no-nom

View file

@ -39,6 +39,8 @@
'';
in
{
ci.buildbot = { inherit (config) devShells; };
devShells = {
default = pkgs.mkShell {
# Install git-hooks when activating the shell

View file

@ -5,6 +5,8 @@
perSystem =
{ config, ... }:
{
ci.buildbot = { inherit (config.checks) pre-commit; };
pre-commit = {
check.enable = true;

View file

@ -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;
};
};
}