mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 08:53:56 -05:00
27 lines
453 B
Nix
27 lines
453 B
Nix
{
|
|
inputs,
|
|
writeShellApplication,
|
|
deadnix,
|
|
statix,
|
|
fd,
|
|
}:
|
|
|
|
writeShellApplication {
|
|
name = "lint";
|
|
runtimeInputs = [
|
|
inputs.self.packages.nixfmt
|
|
deadnix
|
|
statix
|
|
fd
|
|
];
|
|
text = ''
|
|
if [ -z "''${1:-""}" ] || [ "$1" == "." ]; then
|
|
fd '.*\.nix' . -x statix fix -- {} \;
|
|
fd '.*\.nix' . -X deadnix -e -- {} \; -X nixfmt {} \;
|
|
else
|
|
statix fix -- "$1"
|
|
deadnix -e "$1"
|
|
nixfmt "$1"
|
|
fi
|
|
'';
|
|
}
|