checks: Add formatting, statix and deadnix checks

This commit is contained in:
SebastianStork 2026-02-18 19:24:56 +01:00
parent 71132b3c94
commit 3ecc10c445
Signed by: SebastianStork
SSH key fingerprint: SHA256:tRrGdjYOwgHxpSc/wTOZQZEjxcb15P0tyXRsbAfd+2Q
5 changed files with 95 additions and 10 deletions

20
flake-parts/checks.nix Normal file
View file

@ -0,0 +1,20 @@
{ inputs, self, ... }:
{
perSystem =
{ inputs', pkgs, ... }:
{
checks = {
formatting = (inputs.treefmt.lib.evalModule pkgs "${self}/treefmt.nix").config.build.check self;
statix = pkgs.runCommand "statix" { buildInputs = [ inputs'.statix.packages.statix ]; } ''
statix check ${self}
touch $out
'';
deadnix = pkgs.runCommand "deadnix" { buildInputs = [ pkgs.deadnix ]; } ''
deadnix --fail ${self}
touch $out
'';
};
};
}

View file

@ -1,16 +1,8 @@
{ inputs, ... }:
{ inputs, self, ... }:
{
perSystem =
{ pkgs, ... }:
{
formatter =
(inputs.treefmt.lib.evalModule pkgs {
projectRootFile = "flake.nix";
programs = {
nixfmt.enable = true;
prettier.enable = true;
just.enable = true;
};
}).config.build.wrapper;
formatter = (inputs.treefmt.lib.evalModule pkgs "${self}/treefmt.nix").config.build.wrapper;
};
}