mirror of
https://github.com/Gerg-L/nixos.git
synced 2025-12-10 00:43:56 -05:00
fix mkPackages
move "lint" command to /packages
This commit is contained in:
parent
7f33afb985
commit
a132ccf4b6
4 changed files with 71 additions and 88 deletions
32
packages/lint/package.nix
Normal file
32
packages/lint/package.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
inputs,
|
||||
nixfmt,
|
||||
writeShellApplication,
|
||||
deadnix,
|
||||
statix,
|
||||
fd,
|
||||
}:
|
||||
|
||||
writeShellApplication {
|
||||
name = "lint";
|
||||
runtimeInputs = [
|
||||
(nixfmt.overrideAttrs {
|
||||
version = "0.6.0-${inputs.nixfmt.shortRev}";
|
||||
|
||||
src = inputs.nixfmt;
|
||||
})
|
||||
deadnix
|
||||
statix
|
||||
fd
|
||||
];
|
||||
text = ''
|
||||
if [ -z "''${1:-""}" ]; then
|
||||
fd '.*\.nix' . -x statix fix -- {} \;
|
||||
fd '.*\.nix' . -X deadnix -e -- {} \; -X nixfmt {} \;
|
||||
else
|
||||
statix fix -- "$1"
|
||||
deadnix -e "$1"
|
||||
nixfmt "$1"
|
||||
fi
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue