{
  self,
  lib,
  stdenv,
  alejandra,
  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 = [alejandra deadnix statix];
    checkPhase = ''
      mkdir -p $out
      alejandra --check . | tee $out/alejandra.log
      deadnix --fail | tee $out/deadnix.log
      statix check | tee $out/statix.log
    '';
  }