mirror of
https://github.com/Mic92/nix-update.git
synced 2024-11-05 02:16:07 +03:00
47 lines
1.0 KiB
Nix
47 lines
1.0 KiB
Nix
{ lib, inputs, ... }: {
|
|
imports = [
|
|
inputs.treefmt-nix.flakeModule
|
|
];
|
|
|
|
perSystem = { pkgs, ... }: {
|
|
treefmt = {
|
|
# Used to find the project root
|
|
projectRootFile = "flake.lock";
|
|
|
|
programs.prettier.enable = true;
|
|
programs.mypy.enable = true;
|
|
|
|
settings.formatter = {
|
|
nix = {
|
|
command = "sh";
|
|
options = [
|
|
"-eucx"
|
|
''
|
|
# First deadnix
|
|
${lib.getExe pkgs.deadnix} --edit "$@"
|
|
# Then nixpkgs-fmt
|
|
${lib.getExe pkgs.nixpkgs-fmt} "$@"
|
|
''
|
|
"--"
|
|
];
|
|
includes = [ "*.nix" ];
|
|
excludes = [ "nix/sources.nix" ];
|
|
};
|
|
|
|
python = {
|
|
command = "sh";
|
|
options = [
|
|
"-eucx"
|
|
''
|
|
${lib.getExe pkgs.ruff} --fix "$@"
|
|
${lib.getExe pkgs.ruff} format "$@"
|
|
''
|
|
"--" # this argument is ignored by bash
|
|
];
|
|
includes = [ "*.py" ];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|