feat(checks): Fully rework lints

This is currently copied from my dotfiles. Should probably consider
using flake-parts to DRY this out.
This commit is contained in:
Tristan Daniël Maat 2025-11-13 01:29:19 +08:00
parent a90ba627bd
commit 79eb8f9424
Signed by: tlater
GPG key ID: 02E935006CF2E8E7
4 changed files with 221 additions and 820 deletions

35
checks/lib.nix Normal file
View file

@ -0,0 +1,35 @@
{ pkgs, lib, ... }:
{
mkLint =
{
name,
fileset,
checkInputs ? [ ],
script,
}:
pkgs.stdenvNoCC.mkDerivation {
inherit name;
src = lib.fileset.toSource {
root = ../.;
fileset = lib.fileset.difference fileset (
lib.fileset.fileFilter (
file: file.type != "regular" || file.name == "hardware-configuration.nix"
) ../.
);
};
checkInputs = [ pkgs.nushell ] ++ checkInputs;
checkPhase = ''
nu -c '${script}' | tee $out
'';
dontPatch = true;
dontConfigure = true;
dontBuild = true;
dontInstall = true;
dontFixup = true;
doCheck = true;
};
}