Summary
Add support for nixfmt as a built-in formatter for .nix files.
Context
nixfmt is the official Nix formatter (RFC 166)
- OpenCode already has LSP support for Nix via
nixd, but no formatter
- As of NixOS 25.11,
pkgs.nixfmt is the stable RFC-style formatter
Proposed Solution
Add nixfmt to the built-in formatters following the existing pattern (like gofmt, gleam, shfmt):
- Extensions:
.nix
- Command:
nixfmt $FILE
- Enabled when
nixfmt is available in PATH