2023-11-29 09:13:11 +03:00
|
|
|
{ lib, inputs, ... }: {
|
|
|
|
imports = [
|
|
|
|
inputs.treefmt-nix.flakeModule
|
|
|
|
];
|
|
|
|
|
|
|
|
perSystem = { pkgs, ... }: {
|
|
|
|
treefmt = {
|
|
|
|
# Used to find the project root
|
|
|
|
projectRootFile = "flake.lock";
|
|
|
|
|
2023-12-14 20:55:33 +03:00
|
|
|
programs = {
|
|
|
|
deadnix.enable = true;
|
|
|
|
deno.enable = true;
|
|
|
|
mypy.enable = true;
|
|
|
|
nixpkgs-fmt.enable = true;
|
|
|
|
shellcheck.enable = true;
|
|
|
|
shfmt.enable = true;
|
|
|
|
statix.enable = true;
|
|
|
|
};
|
2023-11-29 09:13:11 +03:00
|
|
|
|
2023-12-14 20:55:33 +03:00
|
|
|
settings.formatter =
|
|
|
|
let
|
|
|
|
sh-includes = [ "*.sh" "direnvrc" ];
|
|
|
|
in
|
|
|
|
{
|
|
|
|
python = {
|
|
|
|
command = "sh";
|
|
|
|
options = [
|
|
|
|
"-eucx"
|
|
|
|
''
|
|
|
|
${lib.getExe pkgs.ruff} --fix "$@"
|
|
|
|
${lib.getExe pkgs.ruff} format "$@"
|
|
|
|
''
|
|
|
|
"--" # this argument is ignored by bash
|
|
|
|
];
|
|
|
|
includes = [ "*.py" ];
|
|
|
|
};
|
2023-11-29 09:13:11 +03:00
|
|
|
|
2023-12-14 20:55:33 +03:00
|
|
|
shellcheck.includes = sh-includes;
|
|
|
|
|
|
|
|
shfmt.includes = sh-includes;
|
2023-11-29 09:13:11 +03:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|