add deadnix to formatter

This commit is contained in:
Jörg Thalheim
2023-07-21 11:23:10 +02:00
parent 22849366d8
commit 3ab90e6785
9 changed files with 18 additions and 11 deletions

View File

@@ -9,8 +9,21 @@
treefmt.projectRootFile = "flake.nix";
treefmt.flakeCheck = true;
treefmt.flakeFormatter = true;
treefmt.programs.nixpkgs-fmt.enable = true;
treefmt.programs.shellcheck.enable = true;
treefmt.settings.formatter.nix = {
command = "sh";
options = [
"-eucx"
''
# First deadnix
${lib.getExe pkgs.deadnix} --edit "$@"
# Then nixpkgs-fmt
${lib.getExe pkgs.nixpkgs-fmt} "$@"
''
"--" # this argument is ignored by bash
];
includes = [ "*.nix" ];
};
treefmt.settings.formatter.python = {
command = "sh";
options = [