tlaternet-webserver/nix/checks/lint-nix.nix

32 lines
556 B
Nix

{
self,
lib,
stdenv,
nixfmt-rfc-style,
deadnix,
statix,
}:
let
inherit (lib) sourceFilesBySuffices;
in
stdenv.mkDerivation {
dontPatch = true;
dontConfigure = true;
dontBuild = true;
dontInstall = true;
doCheck = true;
name = "lint-nix";
src = sourceFilesBySuffices self [ ".nix" ];
checkInputs = [
nixfmt-rfc-style
deadnix
statix
];
checkPhase = ''
mkdir -p $out
nixfmt --strict --check . | tee $out/nixfmt.log
deadnix --fail | tee $out/deadnix.log
statix check | tee $out/statix.log
'';
}