https://github.com/zed-extensions/nix
Nix language support in Zed
https://github.com/zed-extensions/nix
Last synced: 5 months ago
JSON representation
Nix language support in Zed
- Host: GitHub
- URL: https://github.com/zed-extensions/nix
- Owner: zed-extensions
- License: mit
- Created: 2024-03-01T05:13:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-12-29T17:27:15.000Z (6 months ago)
- Last Synced: 2026-01-01T22:36:03.256Z (6 months ago)
- Language: Tree-sitter Query
- Size: 43 KB
- Stars: 86
- Watchers: 4
- Forks: 19
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - zed-extensions/nix - Nix language support in Zed (Tree-sitter Query)
README
# Nix
Nix language support in Zed
## Configuration
Various options can be configured via [Zed `settings.json`](https://zed.dev/docs/configuring-zed#settings-files) files.
### Configure Nixd
```json
{
"lsp": {
"nixd": {
"settings": {
"diagnostic": {
"suppress": [ "sema-extra-with" ]
}
}
}
}
}
```
See: [Nixd LSP Configuration Docs](https://github.com/nix-community/nixd/blob/main/nixd/docs/configuration.md) for more options.
### Configure Nil
```json
{
"lsp": {
"nil": {
"settings": {
"diagnostics": {
"ignored": [ "unused_binding" ]
}
}
}
}
}
```
See: [Nil LSP Configuration Docs](https://github.com/oxalica/nil/blob/main/docs/configuration.md) for more options.
### Only use Nixd
```json
{
"languages": {
"Nix": {
"language_servers": [ "nixd", "!nil" ]
}
}
}
```
### Only use Nil
```json
{
"languages": {
"Nix": {
"language_servers": [ "nil", "!nixd" ]
}
}
}
```
### Configure formatters
You can configure formatters through LSP:
```jsonc
{
"lsp": {
"nil": { // or "nixd":
"initialization_options": {
"formatting": {
"command": ["alejandra", "--quiet", "--"] // or ["nixfmt"]
}
}
}
}
}
```
Or through Zed itself:
```jsonc
{
"languages": {
"Nix": {
"formatter": {
"external": {
"command": "alejandra", // or "nixfmt"
"arguments": ["--quiet", "--"]
}
}
}
}
}
```