2023-09-10 20:27:00 +03:00
|
|
|
{ lib, inputs, ... }: {
|
|
|
|
imports = [
|
|
|
|
inputs.treefmt-nix.flakeModule
|
|
|
|
];
|
|
|
|
|
|
|
|
perSystem = { pkgs, ... }: {
|
|
|
|
treefmt = {
|
|
|
|
# Used to find the project root
|
|
|
|
projectRootFile = "flake.lock";
|
|
|
|
|
|
|
|
programs.mypy.enable = true;
|
2023-09-17 21:37:02 +03:00
|
|
|
programs.deno.enable = lib.elem pkgs.hostPlatform.system [
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
"aarch64-darwin"
|
|
|
|
];
|
2023-09-10 20:27:00 +03:00
|
|
|
|
|
|
|
settings.formatter = {
|
|
|
|
nix = {
|
|
|
|
command = "sh";
|
|
|
|
options = [
|
|
|
|
"-eucx"
|
|
|
|
''
|
|
|
|
# First deadnix
|
|
|
|
${lib.getExe pkgs.deadnix} --edit "$@"
|
|
|
|
# Then nixpkgs-fmt
|
|
|
|
${lib.getExe pkgs.nixpkgs-fmt} "$@"
|
|
|
|
''
|
|
|
|
"--"
|
|
|
|
];
|
|
|
|
includes = [ "*.nix" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
python = {
|
|
|
|
command = "sh";
|
|
|
|
options = [
|
|
|
|
"-eucx"
|
|
|
|
''
|
|
|
|
${lib.getExe pkgs.ruff} --fix "$@"
|
|
|
|
${lib.getExe pkgs.black} "$@"
|
|
|
|
''
|
|
|
|
"--" # this argument is ignored by bash
|
|
|
|
];
|
|
|
|
includes = [ "*.py" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|