2024-08-24 23:36:19 -07:00
|
|
|
# Code formatters
|
|
|
|
{pkgs, ...}: {
|
|
|
|
extraPackages = with pkgs; [
|
2024-09-02 18:25:15 -07:00
|
|
|
# TS/JS, Markdown, TOML, JSON, etc
|
2024-08-24 23:36:19 -07:00
|
|
|
nodePackages.prettier
|
|
|
|
|
|
|
|
# Rust
|
|
|
|
rustfmt
|
|
|
|
|
|
|
|
# Nix
|
2024-09-02 18:25:15 -07:00
|
|
|
nixfmt-rfc-style
|
2024-08-24 23:36:19 -07:00
|
|
|
|
|
|
|
# Python
|
|
|
|
black
|
|
|
|
|
|
|
|
# Lua
|
|
|
|
stylua
|
|
|
|
|
|
|
|
# Haskell
|
|
|
|
haskellPackages.fourmolu
|
|
|
|
|
|
|
|
# Misc
|
2024-09-02 18:25:15 -07:00
|
|
|
# codespell
|
2024-08-24 23:36:19 -07:00
|
|
|
];
|
|
|
|
|
|
|
|
plugins.conform-nvim = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
format_on_save = {
|
|
|
|
timeoutMs = 500;
|
|
|
|
lspFallback = true;
|
|
|
|
};
|
|
|
|
formatters_by_ft = {
|
|
|
|
lua = ["stylua"];
|
|
|
|
python = ["black"];
|
2024-09-02 18:25:15 -07:00
|
|
|
nix = ["nixfmt"];
|
2024-08-24 23:36:19 -07:00
|
|
|
svelte = ["prettier"];
|
|
|
|
rust = ["rustfmt"];
|
|
|
|
haskell = ["fourmolu"];
|
2024-09-02 18:25:15 -07:00
|
|
|
toml = ["prettier"];
|
|
|
|
json = ["prettier"];
|
|
|
|
markdown = ["prettier"];
|
|
|
|
yaml = ["prettier"];
|
|
|
|
html = ["prettier"];
|
|
|
|
javascript = ["prettier"];
|
|
|
|
typescript = ["prettier"];
|
|
|
|
# "*" = ["codespell"];
|
2024-08-24 23:36:19 -07:00
|
|
|
"_" = ["trim_whitespace"];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|