feat(checks): Add linters

This commit is contained in:
Tristan Daniël Maat 2025-05-20 20:37:05 +08:00
parent fc991a0b07
commit 5c6b697e55
Signed by: tlater
GPG key ID: 49670FD774E43268
3 changed files with 92 additions and 1 deletions

52
checks/default.nix Normal file
View file

@ -0,0 +1,52 @@
{
self,
nixpkgs,
deploy-rs,
system,
...
}:
let
pkgs = nixpkgs.legacyPackages.${system};
runNuCheck =
{
name,
packages,
check,
}:
pkgs.stdenvNoCC.mkDerivation {
inherit name;
src = nixpkgs.lib.cleanSourceWith {
src = self;
filter = nixpkgs.lib.cleanSourceFilter;
};
dontPatch = true;
dontConfigure = true;
dontBuild = true;
dontInstall = true;
dontFixup = true;
doCheck = true;
checkInputs = nixpkgs.lib.singleton pkgs.nushell ++ packages;
checkPhase = ''
nu ${check}
'';
};
in
nixpkgs.lib.recursiveUpdate {
lints = runNuCheck {
name = "lints";
packages = [
pkgs.deadnix
pkgs.nixfmt-rfc-style
pkgs.shellcheck
pkgs.statix
];
check = ./lints.nu;
};
} (deploy-rs.lib.${system}.deployChecks self.deploy)