A flake checker (treefmt & nix-unit) for testing other flakes with zero dependencies.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Nix 100.0%
32 1 1

Clone this repository

https://tangled.org/oeiuwq.com/checkmate https://tangled.org/did:plc:hwcqoy35x55nzde2sm6dbvq7/checkmate
git@tangled.org:oeiuwq.com/checkmate git@tangled.org:did:plc:hwcqoy35x55nzde2sm6dbvq7/checkmate

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

Checkmate - A flake checker (treefmt & nix-unit) for testing other flakes with zero dependencies.#

Checks include:

  • treefmt - nixfmt, deadnix, mdformat, yamlfmt. See treefmt.nix.

  • nix-unit - The flake being checked (ie, inputs.target) is expected to expose flakeModules.nix-unit:

# Example
flakeModules.nix-unit =
  { inputs, ... }:
  {
    perSystem = (
      { lib, ... }:
      {
        nix-unit.tests = {
          checkmate."test lib works" = {
            expr = lib.removeSuffix ".nix" "hello.nix";
            expected = "hello";
          };
        };
      }
    );
  };

CI Usage#

On your github action:

on:
  pull_request:
  push:
    branches: [main]
jobs:
  flake-check:
    name: nix flake check
    runs-on: ubuntu-latest
    steps:
      - uses: cachix/install-nix-action@v30
      - run: nix flake check -L github:vic/checkmate --override-input target github:$GITHUB_REPOSITORY/
$GITHUB_SHA

As a fully working example, see:

https://github.com/vic/import-tree