zig
Getting Started
Use the version attribute to select the Zig compiler from zig-overlay and the matching ZLS (Zig Language Server) release:
languages.zig = {
enable = true;
version = "0.15.1";
};
This will automatically:
- Use the specified Zig version from zig-overlay
- Install the corresponding ZLS version (e.g., version “0.15.1” uses ZLS 0.15.0)
Add the required inputs before starting the environment. For the example above:
devenv inputs add zig-overlay github:mitchellh/zig-overlay --follows nixpkgs
devenv inputs add zls github:zigtools/zls/0.15.0 --follows nixpkgs --follows zig-overlay
For Zig 0.16.0, use version = "0.16.0" and add ZLS with devenv inputs add zls github:zigtools/zls/0.16.0 --follows nixpkgs. ZLS 0.16 uses its own zig-flake input instead of zig-overlay. Setting languages.zig.lsp.enable = false disables ZLS and removes the need for the zls input.
Alternatively, you can manually specify packages:
languages.zig = {
enable = true;
package = pkgs.zig;
lsp.package = pkgs.zls;
};Options
languages.zig.enable
Whether to enable tools for Zig development.
Type: boolean
Default:
false
Example:
true
Declared by:
languages.zig.package
Which package of Zig to use.
Type: package
Default:
pkgs.zig
Declared by:
languages.zig.lsp.enable
Whether to enable Zig Language Server.
Type: boolean
Default:
true
Example:
true
Declared by:
languages.zig.lsp.package
The Zig language server package to use.
Type: package
Default:
pkgs.zls
Declared by:
languages.zig.version
The Zig version to use. This sets languages.zig.package using zig-overlay and languages.zig.lsp.package using the matching ZLS release.
Type: null or string
Default:
null
Example:
"0.15.1"
Declared by:
Last updated Oct 11, 2026