// plugins

Nix Plugin

Wrapper plugin that formats Nix code via nixfmt-rs, a Rust port of nixfmt.

Formats .nix files.

This plugin is updated after upstream nixfmt and nixfmt-rs, so its output can lag behind the latest nixfmt. We recommend against using it for nixpkgs or other NixOS organization contributions.

Install and Setup

In your project's directory with a dprint.json file, run:

dprint add nix

This will update your config file to have an entry for the plugin. Then optionally specify a "nix" property to add configuration:

{
  "nix": {
    // nix config goes here
  },
  "plugins": [
    "npm:@dprint/nix@x.x.x"
  ]
}

Configuration

See Configuration.

Source

See https://github.com/dprint/dprint-plugin-nix