From a758ff7808d067c6f7f7143cb5b5d5cf95da4a21 Mon Sep 17 00:00:00 2001 From: "Gustavo \"Guz\" L de Mello" Date: Sat, 30 Aug 2025 13:35:25 -0300 Subject: [PATCH] feat: attempt of using nix fmt as formatter --- lua/dot013/plugins/formatting.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lua/dot013/plugins/formatting.lua b/lua/dot013/plugins/formatting.lua index 1993ad8..dbffcd5 100644 --- a/lua/dot013/plugins/formatting.lua +++ b/lua/dot013/plugins/formatting.lua @@ -31,7 +31,7 @@ return { formatters_by_ft = { -- Simple formatters lua = { "stylua" }, - nix = { "alejandra" }, + nix = { --[[ "nixcmdfmt", ]] "alejandra", stop_after_first = true }, rust = { "rustfmt", lsp_format = "fallback" }, sh = { "shellharden", "shfmt" }, xml = { "xmllint", "xmltidy" }, @@ -87,12 +87,20 @@ return { mdfmt = { command = "mdfmt", }, - -- Uses HTML Tidy xmltidy = { inherit = false, + -- Uses HTML Tidy command = "tidy", args = { "-xml", "-indent", "yes", "2", "-wrap", "100", "-" }, }, + --[[ nixcmdfmt = { + inherit = false, + stdin = false, + cwd = require("conform.util").root_file({ "flake.nix" }), + require_cwd = true, + command = "nix", + args = { "fmt", "$FILENAME" }, + }, ]] }, }) end,