11.stylix/flake/default.nix
NAHO d66135deb3
flake: add ruff formatter (#1389)
Link: https://github.com/nix-community/stylix/pull/1389

Reviewed-by: awwpotato <awwpotato@voidq.com>
Co-authored-by: NAHO <90870942+trueNAHO@users.noreply.github.com>
Reviewed-by: Matt Sturgeon <matt@sturgeon.me.uk>
2025-05-26 18:06:05 +02:00

56 lines
1.3 KiB
Nix

{
imports = [
./deprecated.nix
./dev-shell.nix
./modules.nix
./packages.nix
./pre-commit.nix
];
perSystem =
{ pkgs, ... }:
{
# TODO: consider using https://flake.parts/options/treefmt-nix.html once
# dev flake is partitioned
formatter = pkgs.treefmt.withConfig {
runtimeInputs = with pkgs; [
nixfmt-rfc-style
ruff
stylish-haskell
keep-sorted
];
settings = {
on-unmatched = "info";
tree-root-file = "flake.nix";
formatter = {
stylish-haskell = {
command = "stylish-haskell";
includes = [ "*.hx" ];
};
ruff = {
command = "ruff";
options = [
"--config"
(pkgs.writers.writeTOML "ruff.toml" {
line-length = 80;
})
"format"
];
includes = [ "*.py" ];
};
nixfmt = {
command = "nixfmt";
options = [ "--width=80" ];
includes = [ "*.nix" ];
};
keep-sorted = {
command = "keep-sorted";
includes = [ "*" ];
};
};
};
};
};
}