[Skip to content](#main)

[→](/)

[![Avunu](/brand/avunu-logo.svg)![Avunu](/brand/avunu-logo-light.svg)](/)[Services](/services/)[Consulting](/services/consulting/)[ERP](/services/erp/)[Odoo](/services/erp/odoo/)[ERPNext](/services/erp/erpnext/)[Custom software](/services/custom-software/)[Devices & IoT](/services/devices-iot/)[Websites](/services/websites/)[Infrastructure](/services/infrastructure/)[Partners](/partners/)

[Work](/work/)[Open source](/open-source/)[Knowledge base](/kb/)[About](/about/)

[About Avunu](/about/)[Team](/about/team/)[Insights](/insights/)[Contact](/contact/)

[Client portal](https://erp.avunu.net/projects)[Start a project](/start/)

- [Services](/services/)[Consulting](/services/consulting/)
- [ERP](/services/erp/)
- [Odoo](/services/erp/odoo/)
- [ERPNext](/services/erp/erpnext/)
- [Custom software](/services/custom-software/)
- [Devices & IoT](/services/devices-iot/)
- [Websites](/services/websites/)
- [Infrastructure](/services/infrastructure/)
- [Partners](/partners/)

[Work](/work/)[Open source](/open-source/)[Knowledge base](/kb/)[About](/about/)

- [About Avunu](/about/)
- [Team](/about/team/)
- [Insights](/insights/)
- [Contact](/contact/)

[Client portal](https://erp.avunu.net/projects)[Start a project](/start/)

[Knowledge base](/kb/)[NixOS](/kb/nixos/)Get started with Nix-based development on a new host

Search the knowledge basePress/

ESC

Jump to

[Browse the knowledge base](/kb/)[Frappe](/kb/frappe/)[ERPNext](/kb/erpnext/)[Odoo](/kb/odoo/)[WordPress](/kb/wordpress/)[NixOS](/kb/nixos/)[Email](/kb/email/)[Linux](/kb/linux/)[Databases](/kb/databases/)[Containers](/kb/containers/)[Proxmox](/kb/proxmox/)[Git & Dev Tools](/kb/git-and-dev-tools/)

↵select↑↓navigateescclose

Search the knowledge base

[Skip to the article](#kb-article)[NixOS](/kb/nixos/)3 articles

- [Overview](/kb/nixos/)
- [Get started with Nix-based development on a new host](/kb/nixos/getting-started-nix-development/)
- [Reference architecture for self-hosting business systems on NixOS](/kb/nixos/reference-architecture-for-self-hosting-business-systems/)
- [Why Nix for business systems](/kb/nixos/why-nix-for-business-systems/)

Other sections[Frappe](/kb/frappe/)[ERPNext](/kb/erpnext/)[Odoo](/kb/odoo/)[WordPress](/kb/wordpress/)[Email](/kb/email/)[Linux](/kb/linux/)[Databases](/kb/databases/)[Containers](/kb/containers/)[Proxmox](/kb/proxmox/)[Git & Dev Tools](/kb/git-and-dev-tools/)

In NixOS: 3 articles

[Overview](/kb/nixos/)[Get started with Nix-based development on a new host](/kb/nixos/getting-started-nix-development/)[Reference architecture for self-hosting business systems on NixOS](/kb/nixos/reference-architecture-for-self-hosting-business-systems/)[Why Nix for business systems](/kb/nixos/why-nix-for-business-systems/)

Other sections[Frappe](/kb/frappe/)[ERPNext](/kb/erpnext/)[Odoo](/kb/odoo/)[WordPress](/kb/wordpress/)[Email](/kb/email/)[Linux](/kb/linux/)[Databases](/kb/databases/)[Containers](/kb/containers/)[Proxmox](/kb/proxmox/)[Git & Dev Tools](/kb/git-and-dev-tools/)

NixOSGet started with Nix-based development on a new host

Set up a new Mac, Windows (WSL) or NixOS machine for Nix-based projects with flakes, direnv and VS Code, using Avunu's ready-made development configurations.

UpdatedNov 24, 2026

Applies toDeterminate NixmacOSWindows 11 with WSL 2NixOS

Tagsnixdirenvvscodemacoswslnixos

Reading time5 min

On this page[How it works](#how-it-works)[macOS](#macos)[Windows](#windows)[NixOS](#nixos)[Use it as a reference](#use-it-as-a-reference)[Install the direnv extension](#install-the-direnv-extension)[Clone the project and allow direnv](#clone-the-project-and-allow-direnv)[Check that it works](#check-that-it-works)[Troubleshooting](#troubleshooting)

Use this page to get a new computer ready to work on any Avunu Nix project, such as [frappe-nix](https://docs.avunu.net/frappe-nix/docs/getting-started/), [odoo-nix](https://docs.avunu.net/odoo-nix/docs/getting-started/) or [wordpress-nix](https://docs.avunu.net/wordpress-nix/docs/getting-started/). Pick your platform, follow its steps top to bottom, then finish with the shared steps at the end.

## How it works

Every platform follows the same five steps. Only the first two differ.

Install Nix with flakes enabled. We use [Determinate Nix](https://docs.determinate.systems/), which has flakes on by default.

Enable direnv, so a project's tools load automatically when you enter its folder.

Install the direnv extension in VS Code.

Clone the project.

Run `direnv allow` in the project folder.

To save you the setup work on steps 1 and 2, Avunu publishes development configurations for each platform. They install Nix settings, direnv, and the common toolchain (Git, Node, Bun, Python, container tools) in one command.

| Platform | Configuration                                                           |
| -------- | ----------------------------------------------------------------------- |
| macOS    | [nix-dev-macos](https://github.com/Avunu/nix-dev-macos)                 |
| Windows  | [nixos-wsl](https://github.com/Avunu/nixos-wsl) (NixOS on WSL)          |
| NixOS    | [nixos-dev-workstation](https://github.com/Avunu/nixos-dev-workstation) |

## macOS

Works on Apple Silicon and Intel Macs.

[Install Determinate Nix](https://determinate.systems/install/).

Apply the Avunu configuration by running the following in a terminal window. It installs direnv and the development toolchain.

```
<span style="--shiki-dark:#FFA657;--shiki-light:#953800">sudo</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">nix</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">run</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">nix-darwin/master#darwin-rebuild</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">--</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">switch</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">\</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">  </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">--flake</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">github:Avunu/nix-dev-macos#default</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">--refresh</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">--impure</span>
```

If activation stops because an existing `/etc` file is in the way, it prints a message naming the file. Move the file aside as the message says (for example `sudo mv /etc/zshrc /etc/zshrc.before-nix-darwin`) and run the command again.

Install [VS Code](https://code.visualstudio.com/) if you don't have it.

Continue with [Install the direnv extension](#install-the-direnv-extension).

The configuration keeps itself current. A daily job rebuilds the system when the repository changes, and you can run `system-upgrade` to update right away.

## Windows

Windows development runs inside NixOS on WSL 2, and VS Code on Windows connects into it.

Install [VS Code](https://code.visualstudio.com/) on Windows, then add the **WSL** extension (`ms-vscode-remote.remote-wsl`).

Install NixOS-WSL. Download `nixos.wsl` from the [NixOS-WSL releases page](https://github.com/nix-community/NixOS-WSL/releases/latest), then run this in PowerShell from the download folder:

```powershell
wsl --install --from-file nixos.wsl
```

Open the NixOS terminal.

```powershell
wsl -d NixOS
```

Apply the Avunu configuration inside NixOS. It enables flakes, direnv with nix-direnv, and the VS Code server integration.

```
<span style="--shiki-dark:#FFA657;--shiki-light:#953800">sudo</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">nixos-rebuild</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">switch</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">--flake</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">github:Avunu/nixos-wsl#nixos</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">--refresh</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">--impure</span>
```

Close the terminal and run `wsl --shutdown` in PowerShell, then reopen NixOS so the new settings apply.

Continue with [Install the direnv extension](#install-the-direnv-extension). Do the VS Code steps from a window connected to WSL (run `code .` from the NixOS terminal).

Important

Clone projects into the Linux home directory (`~/`), not under `/mnt/c`. Nix and file watchers are many times slower on the Windows filesystem.

Tip

If a rebuild fails and leaves NixOS unusable, run `wsl -d NixOS --system --user root -- /mnt/wslg/distro/bin/nixos-wsl-recovery` in PowerShell, then retry step 4.

The machine updates itself daily from the repository. Run `system-upgrade` to update sooner.

## NixOS

Moving a machine to NixOS is optional and replaces the existing operating system. Use [nixos-dev-workstation](https://github.com/Avunu/nixos-dev-workstation) directly if you want a ready-made Avunu workstation, or as a reference for your own configuration.

### Use it as a reference

On a machine that already runs NixOS, copy only what you need from the profile. The minimum for this workflow is direnv with nix-direnv:

```
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">{</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">  </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">programs</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">.</span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">direnv</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> {</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">    </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">enable</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">true</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">;</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">    </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">nix-direnv</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">.</span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">enable</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">=</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">true</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">;</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">  };</span>
<span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">}</span>
```

## Install the direnv extension

Do this once per VS Code installation. On Windows, do it in a window connected to WSL so the extension installs in WSL.

Open VS Code, press `Ctrl+Shift+X` (`Cmd+Shift+X` on macOS), and search for **direnv**.

Install the extension by `mkhl` (`mkhl.direnv`), or run this in a terminal:

```
<span style="--shiki-dark:#FFA657;--shiki-light:#953800">code</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">--install-extension</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">mkhl.direnv</span>
```

## Clone the project and allow direnv

Clone the project into a folder in your home directory.

```
<span style="--shiki-dark:#FFA657;--shiki-light:#953800">git</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">clone</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">https://github.com/</span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E"><</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">OWNE</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">R</span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">></span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">/</span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E"><</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">PROJEC</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">T</span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">></span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">.git</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">~/Development/</span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E"><</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">PROJEC</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">T</span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">></span>
<span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">cd</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">~/Development/</span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E"><</span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">PROJEC</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328">T</span><span style="--shiki-dark:#FF7B72;--shiki-light:#CF222E">></span>
```

Allow direnv for the folder. This tells direnv you trust the project's `.envrc`.

```
<span style="--shiki-dark:#FFA657;--shiki-light:#953800">direnv</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">allow</span>
```

Open the folder in VS Code.

```
<span style="--shiki-dark:#FFA657;--shiki-light:#953800">code</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">.</span>
```

The first load downloads and builds the project's tools, which can take several minutes. After that it loads in seconds and happens automatically whenever you enter the folder. If Nix asks whether to trust a binary cache, answer yes for Avunu projects.

Note

Run `direnv allow` again whenever the project's `.envrc` changes. direnv blocks a changed file until you approve it.

## Check that it works

From the project folder, confirm the environment loaded:

```
<span style="--shiki-dark:#FFA657;--shiki-light:#953800">direnv</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#A5D6FF;--shiki-light:#0A3069">status</span>
<span style="--shiki-dark:#FFA657;--shiki-light:#953800">nix</span><span style="--shiki-dark:#E6EDF3;--shiki-light:#1F2328"> </span><span style="--shiki-dark:#79C0FF;--shiki-light:#0550AE">--version</span>
```

The status output should say the `.envrc` is allowed and loaded. If VS Code does not pick up the tools, run **direnv: Restart** from the Command Palette (`Ctrl+Shift+P`).

## Troubleshooting

| Symptom                                                               | Fix                                                                                            |
| --------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `direnv: command not found` or nothing happens on `cd`                | Open a new terminal. If it persists, the configuration step did not finish; rerun it.          |
| `direnv: error .envrc is blocked`                                     | Run `direnv allow` in the project folder.                                                      |
| VS Code terminals have the tools but the editor and extensions do not | Install `mkhl.direnv`, then run **direnv: Restart**. On Windows, check it is installed in WSL. |
| Slow file access or builds on Windows                                 | The project is under `/mnt/c`. Move it into `~/`.                                              |
| `experimental Nix feature 'flakes' is disabled`                       | Nix was not installed with Determinate Nix, or the configuration has not been applied yet.     |

Sources

- [docs.determinate.systems](https://docs.determinate.systems/)
- [github.com/Avunu/nix-dev-macos](https://github.com/Avunu/nix-dev-macos)
- [github.com/Avunu/nixos-wsl](https://github.com/Avunu/nixos-wsl)
- [github.com/Avunu/nixos-dev-workstation](https://github.com/Avunu/nixos-dev-workstation)
- [github.com/nix-community/NixOS-WSL](https://github.com/nix-community/NixOS-WSL)
- [direnv.net](https://direnv.net/)

Need help with NixOS?

Our notes can take you a long way, but sometimes you'd rather have someone who's done it before.

[Managed infrastructure](/services/infrastructure/)

[← PreviousOverview](/kb/nixos/)[Next →Reference architecture for self-hosting business systems on NixOS](/kb/nixos/reference-architecture-for-self-hosting-business-systems/)

CC0This article is in the public domain ([CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/)), code samples included. Use it however helps you.

On this page

- [How it works](#how-it-works)
- [macOS](#macos)
- [Windows](#windows)
- [NixOS](#nixos)
- [Use it as a reference](#use-it-as-a-reference)
- [Install the direnv extension](#install-the-direnv-extension)
- [Clone the project and allow direnv](#clone-the-project-and-allow-direnv)
- [Check that it works](#check-that-it-works)
- [Troubleshooting](#troubleshooting)

[Back to top↑](#top)

Services

- [ERP implementation](/services/erp/)
- [Odoo](/services/erp/odoo/)
- [ERPNext](/services/erp/erpnext/)
- [Custom software](/services/custom-software/)
- [Devices & IoT](/services/devices-iot/)
- [Websites](/services/websites/)
- [Infrastructure](/services/infrastructure/)

Resources

- [Our work](/work/)
- [Open source](/open-source/)
- [Knowledge base](/kb/)
- [Insights](/insights/)

Company

- [About](/about/)
- [Team](/about/team/)
- [Partners](/partners/)
- [Contact](/contact/)

Clients

- [Project portal](https://erp.avunu.net/projects)
- [Invoices](https://erp.avunu.net/)
- [Support](https://erp.avunu.net/)

[![Avunu](/brand/avunu-logo-light.svg)](/)[\<av-icon data-jx-static>\<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor" stroke="none" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">\<path d="M20.400 20.500h-3.600v-5.600c0-1.300 0-3-1.800-3s-2.100 1.400-2.100 2.900v5.700H9.400V9h3.400v1.600c.5-.9 1.600-1.900 3.400-1.900 3.600 0 4.300 2.400 4.300 5.500v6.300zM5.300 7.400a2.100 2.100 0 1 1 0-4.100 2.100 2.100 0 0 1 0 4.100zm1.800 13.100H3.600V9h3.500v11.500zM22.200 0H1.800C.8 0 0 .8 0 1.700v20.600c0 .9.800 1.700 1.800 1.700h20.400c1 0 1.800-.8 1.800-1.700V1.700C24 .8 23.200 0 22.200 0z">\</path>\</svg>\</av-icon>](https://www.linkedin.com/company/avunu)[\<av-icon data-jx-static>\<svg viewBox="0 0 24 24" width="20" height="20" fill="currentColor" stroke="none" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">\<path d="M12 .3a12 12 0 0 0-3.8 23.4c.6.1.8-.3.8-.6v-2c-3.3.7-4-1.6-4-1.6-.6-1.4-1.4-1.8-1.4-1.8-1-.7.1-.7.1-.7 1.2.1 1.8 1.2 1.8 1.2 1 1.8 2.8 1.3 3.5 1 .1-.8.4-1.3.7-1.6-2.7-.3-5.5-1.3-5.5-5.9 0-1.3.5-2.4 1.2-3.2-.1-.3-.5-1.5.1-3.2 0 0 1-.3 3.3 1.2a11.500 11.500 0 0 1 6 0c2.300-1.500 3.300-1.200 3.300-1.200.6 1.700.2 2.900.1 3.200.8.8 1.200 1.900 1.200 3.200 0 4.600-2.800 5.600-5.500 5.900.4.400.8 1.100.8 2.200v3.300c0 .3.2.7.8.6A12 12 0 0 0 12 .3">\</path>\</svg>\</av-icon>](https://github.com/Avunu)[Client portal](https://erp.avunu.net/projects)[Start a project](/start/)

Avunu LLC · 948 East Philadelphia Street, York, PA 17403 · (717) 814-8540Knowledge base articles are in the public domain[Privacy](/privacy/)[Terms](/terms/)
