# zig

## Getting Started

The simplest way to get started with Zig is to use the `version` attribute, which automatically sets up both the Zig compiler and ZLS (Zig Language Server) from the [zig-overlay](https://github.com/mitchellh/zig-overlay):

```nix
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)

Alternatively, you can manually specify packages:

```nix
languages.zig = {
  enable = true;
  package = pkgs.zig;
  zls.package = pkgs.zls;
};
```

## Options

### languages.zig.enable

Whether to enable tools for Zig development.

*Type:* boolean

*Default:*

```nix
false
```

*Example:*

```nix
true
```

*Declared by:*

* <https://github.com/cachix/devenv/blob/main/src/modules/languages/zig.nix>

### languages.zig.package

Which package of Zig to use.

*Type:* package

*Default:*

```nix
pkgs.zig
```

*Declared by:*

* <https://github.com/cachix/devenv/blob/main/src/modules/languages/zig.nix>

### languages.zig.lsp.enable

Whether to enable Zig Language Server.

*Type:* boolean

*Default:*

```nix
true
```

*Example:*

```nix
true
```

*Declared by:*

* <https://github.com/cachix/devenv/blob/main/src/modules/languages/zig.nix>

### languages.zig.lsp.package

The Zig language server package to use.

*Type:* package

*Default:*

```nix
pkgs.zls
```

*Declared by:*

* <https://github.com/cachix/devenv/blob/main/src/modules/languages/zig.nix>

### languages.zig.version

The Zig version to use. This automatically sets the `languages.zig.package` and `languages.zig.lsp.package` using [zig-overlay](https://github.com/mitchellh/zig-overlay).

*Type:* null or string

*Default:*

```nix
null
```

*Example:*

```nix
"0.15.1"
```

*Declared by:*

* <https://github.com/cachix/devenv/blob/main/src/modules/languages/zig.nix>