Nix ForgeNix Forge is a lightweight VS Code extension for writing Nix files with less friction. It provides Nix document formatting, quick configuration templates, and optional template updates from the official NixOS Wiki. It is designed to work even when the local machine does not have a full Nix toolchain installed. FeaturesFormat Nix DocumentsNix Forge registers a formatter for Shortcut:
Command Palette:
Formatting behavior:
The built-in formatter is intentionally conservative. It focuses on indentation and delimiter-aware cleanup, which makes it useful on Windows, WSL, remote Linux, and development hosts without Insert Nix TemplatesNix Forge can insert common Nix configuration templates into the active editor. Shortcut:
Command Palette:
Built-in fallback templates include:
Inserted templates include short usage comments. If a Chinese VS Code language pack is installed, Nix Forge also adds Chinese source-switching notes and common binary cache mirror URLs. Without a Chinese language pack, those mirror notes are omitted. Fetch Templates from NixOS WikiOn first activation, Nix Forge can fetch Nix examples from the official NixOS Wiki and cache them locally. Sources:
If the network is unavailable or Wiki markup changes, built-in templates remain available. For Chinese-language users, Nix Forge also tries to refresh common Manual refresh:
Formatter Helper CommandsIf you want to use an external formatter, Nix Forge provides helper commands:
Note: VS Code extensions cannot directly install system commands into NixOS, WSL, or remote Linux. A VS Code Extension Pack can only install other VS Code extensions, not SettingsFormatter CommandUse
Use a specific formatter:
Disable the built-in fallback formatter:
Wiki Template UpdatesDisable first-activation Wiki template fetching:
Custom TemplatesAdd your own templates:
|