All checks were successful
build / test (push) Successful in 9s
This saves one flake input and some python dependencies
41 lines
933 B
Nix
41 lines
933 B
Nix
{ lib
|
|
, inputs
|
|
, ...
|
|
}: {
|
|
imports = [
|
|
inputs.treefmt-nix.flakeModule
|
|
];
|
|
perSystem = { pkgs, ... }: {
|
|
treefmt.projectRootFile = "flake.nix";
|
|
treefmt.flakeCheck = true;
|
|
treefmt.flakeFormatter = 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 = [
|
|
"-eucx"
|
|
''
|
|
${lib.getExe pkgs.ruff} --fix "$@"
|
|
${lib.getExe pkgs.black} "$@"
|
|
''
|
|
"--" # this argument is ignored by bash
|
|
];
|
|
includes = [ "*.py" ];
|
|
};
|
|
};
|
|
}
|