mirror of
https://github.com/nix-community/nix-direnv.git
synced 2025-11-08 19:46:11 +01:00
47 lines
1.1 KiB
Nix
47 lines
1.1 KiB
Nix
{ lib, inputs, ... }: {
|
|
imports = [
|
|
inputs.treefmt-nix.flakeModule
|
|
];
|
|
|
|
perSystem = { pkgs, ... }: {
|
|
treefmt = {
|
|
# Used to find the project root
|
|
projectRootFile = "flake.lock";
|
|
|
|
programs.deno.enable = true;
|
|
programs.mypy.enable = true;
|
|
programs.shellcheck.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" ];
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|