Skip to content

[FEATURE]: Add nixfmt formatter for Nix files #6379

@anntnzrb

Description

@anntnzrb

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions