---
title: "Nix on Windows"
description: "How a staged, independently testable path advances reproducible Nix builds across the Windows platform boundary."
url: https://mh0pe.github.io/work/nix-windows/
author: "Madison Hope Steiner"
---

Nix on Windows

# Windows support in testable steps.

The upstream foundation can execute a minimal Windows builder and cross-build the complete project. Public implementations extend that path through recursive builds, lossless filenames, network paths, and explicit process boundaries.

**My decision.** I split the Windows build path into steps so reviewers could test each one on its own.

Nix merged my minimal Windows builder in #16347. The wider runtime, including recursive builds, is usable in my public fork.

[Inspect the minimal Windows builder in Nix PR #16347](https://github.com/NixOS/nix/pull/16347) [Inspect recursive builds in the public fork](https://github.com/awsmadi/nix/tree/feat/windows-recursive-nix-master) Link to this passage

[Nix Windows libstore implementation](https://github.com/awsmadi/nix/tree/feat/windows-builder-parity)

**Who this helps**
Infrastructure and developer-platform teams bringing reproducible builds across operating-system boundaries.

**My role**
I built and validated the Windows execution path in independently testable stages, from the first builder through project-wide cross-builds and recursive operation.

**Current state**
The Windows builder foundation and portable process-handle inheritance are integrated upstream. The wider runtime is available in the linked public fork and branches.

**Public activity**
Public contribution activity · 2026

**Other changes in this project**

Other changes in this project

On GitHub

- [Open project: NixOS/nix](https://github.com/NixOS/nix)

    [**Nix #16347: the minimal Windows builder** Read the reviewed change](https://github.com/NixOS/nix/pull/16347)

    The upstream review and implementation of the first builder are linked here.

    **Implementation details**

    [Builder implementation — libstore: add a minimal derivation builder for Windows](https://github.com/NixOS/nix/commit/6632a08878eac7493971025267018b7eb12766da) [Related file — src/libstore/unix/build/unix-derivation-builder.cc](https://github.com/NixOS/nix/blob/6632a08878eac7493971025267018b7eb12766da/src%2Flibstore%2Funix%2Fbuild%2Funix-derivation-builder.cc)
- NixOS/nix

    [**Nix #16449: which handles a child process inherits** Read the reviewed change](https://github.com/NixOS/nix/pull/16449)

    The review covers handle inheritance across platforms. The commit below is a smaller namespace edit in that review.

    **Implementation details**

    [Namespace edit — More \`using namespace nix::\` in properly platform-specific functions](https://github.com/NixOS/nix/commit/df1bf3423bf025796f88a9bc9a1e7383db7e5016) [Related file — src/libutil/windows/file-descriptor.cc](https://github.com/NixOS/nix/blob/d6384fb0a3aed33a2d1b1d51f80356647f1a942b/src%2Flibutil%2Fwindows%2Ffile-descriptor.cc)

How it works / 06 stages

## From constraint to a system a team can own.

Six stages connect the original pressure to the system that now exists.

Extend the builder. Keep the shared structure.

**Shared Nix builder** Common build logic

**Windows execution**

**A build**

 **Another Nix operation**

Builds can invoke further builds

The shared builder is integrated. The link to the public Windows implementation and the separate validation harness show which later steps were exercised.

1. Pressure

    ### A new platform exposes every hidden assumption.

    Nix’s model depends on stable store paths, isolated builders, deterministic references, and explicit process boundaries. Bringing those semantics across the Windows portability boundary means more than making the code compile. The useful result is a build path whose outputs and failure modes remain understandable under a different process, filesystem, and toolchain model.

    [See the starting point](https://github.com/NixOS/nix)

    **More links from this decision**

    - [Nix #16347, Windows derivation builder](https://github.com/NixOS/nix/pull/16347)

2. Constraint

    ### Windows support must preserve Nix semantics.

    The Windows implementation sits inside a large, portable C++ system. Process creation, handle inheritance, path behavior, executable discovery, daemon communication, store semantics, content-addressed outputs, and cross-compilation all meet at boundaries already relied on by other platforms. Each step needs a narrow seam and a result that can be checked independently.

    - Keep platform hooks narrow and preserve common builder logic.
    - Cross-build every Windows component so unvisited code cannot silently drift.
    - Validate produced results separately from the build that created them.

    [Inspect the boundary](https://github.com/NixOS/nix/pull/16347)

    **More links from this decision**

    - [Nix #16368, whole-project Windows cross-build](https://github.com/NixOS/nix/pull/16368)
    - [Nix Windows validation harness #1](https://github.com/nix-windows/nix-windows-demo/pull/1)

3. Decision

    ### Advance through narrow portability seams.

    The implementation separates a minimal derivation builder, project-wide cross-build coverage, libstore and output semantics, and recursive operation. Each layer can move independently without making the complete capability wait on one large integration step. A separate public validation project checks build results instead of allowing the implementation to grade its own output.

    [Review the decision](https://github.com/NixOS/nix/pull/16347)

    **More links from this decision**

    - [Nix #16368, whole-project Windows cross-build](https://github.com/NixOS/nix/pull/16368)
    - [Nix #16411, Windows libstore gate and output semantics](https://github.com/NixOS/nix/pull/16411)
    - [Nix #16414, recursive Nix on Windows](https://github.com/NixOS/nix/pull/16414)
    - [Nix Windows validation harness #1](https://github.com/nix-windows/nix-windows-demo/pull/1)

4. Implementation

    ### Extend the path from derivation execution to recursive Nix.

    The Windows path adds a minimal derivation builder and brings every project component into the cross-build graph. It turns libstore tests into a meaningful gate, enables content-addressed and fixed-output derivations, restores evaluator startup in the validation environment, and lifts recursive Nix into the shared builder with focused platform hooks.

    - Execute derivations through the shared builder contract.
    - Bring complete Windows components into the cross-build graph.
    - Exercise libstore and recursive operation with independent output checks.
    - Preserve Windows filenames and network-share roots without losing characters during conversion.
    - Make process-handle inheritance portable and reject network-isolation options that have no implemented backend.
    - Coordinate recursive-build shutdown across listening sockets, connected clients, and worker threads.

    [Inspect the build](https://github.com/NixOS/nix/pull/16347)

    **More links from this decision**

    - [Nix #16368, whole-project Windows cross-build](https://github.com/NixOS/nix/pull/16368)
    - [Nix #16411, Windows libstore gate and output semantics](https://github.com/NixOS/nix/pull/16411)
    - [Nix #16414, recursive Nix on Windows](https://github.com/NixOS/nix/pull/16414)
    - [Nix #16449, portable process handle inheritance](https://github.com/NixOS/nix/pull/16449)
    - [Nix #16451, lossless Windows filenames and network paths](https://github.com/NixOS/nix/pull/16451)
    - [Nix #16453, explicit Windows network-isolation contract](https://github.com/NixOS/nix/pull/16453)
    - [Nix, coordinated recursive-build shutdown](https://github.com/awsmadi/nix/commit/05b5212724336d8625adb91c471ea4ac221aca96)
    - [Nix, Windows socket conversion and inheritance](https://github.com/awsmadi/nix/commit/686a596fa8c9b71dfb4938005632bba553608b5a)
    - [Nix Windows validation harness #1](https://github.com/nix-windows/nix-windows-demo/pull/1)

5. State

    ### Windows now has an upstream foundation and a usable wider runtime.

    The Windows derivation builder, complete cross-build coverage, and portable process-handle inheritance are integrated upstream. Public branches extend that foundation with libstore checks, richer output semantics, recursive operation, and lossless filenames. An independent validation harness checks the resulting build path.

    [See where it works](https://github.com/NixOS/nix/pull/16347)

    **More links from this decision**

    - [Nix #16368, whole-project Windows cross-build](https://github.com/NixOS/nix/pull/16368)
    - [Nix #16411, Windows libstore gate and output semantics](https://github.com/NixOS/nix/pull/16411)
    - [Nix #16414, recursive Nix on Windows](https://github.com/NixOS/nix/pull/16414)
    - [Nix #16449, portable process handle inheritance](https://github.com/NixOS/nix/pull/16449)
    - [Nix #16451, lossless Windows filenames and network paths](https://github.com/NixOS/nix/pull/16451)
    - [Nix Windows libstore implementation](https://github.com/awsmadi/nix/tree/feat/windows-builder-parity)
    - [Nix recursive Windows implementation](https://github.com/awsmadi/nix/tree/feat/windows-recursive-nix-master)

6. Source

    ### Inspect the builder, runtime, and independent result checks.

    The linked pull requests connect each Windows capability to its implementation and tests. The Windows libstore and recursive-operation links lead to their specific implementations. Nix's upstream foundation and the independent validation harness are linked separately.

    [Follow the public work](https://github.com/NixOS/nix)

    **More links from this decision**

    - [Nix #16347, Windows derivation builder](https://github.com/NixOS/nix/pull/16347)
    - [Nix #16368, whole-project Windows cross-build](https://github.com/NixOS/nix/pull/16368)
    - [Nix #16411, Windows libstore gate and output semantics](https://github.com/NixOS/nix/pull/16411)
    - [Nix #16414, recursive Nix on Windows](https://github.com/NixOS/nix/pull/16414)
    - [Nix #16449, portable process handle inheritance](https://github.com/NixOS/nix/pull/16449)
    - [Nix #16451, lossless Windows filenames and network paths](https://github.com/NixOS/nix/pull/16451)
    - [Nix, coordinated recursive-build shutdown](https://github.com/awsmadi/nix/commit/05b5212724336d8625adb91c471ea4ac221aca96)
    - [Nix, Windows socket conversion and inheritance](https://github.com/awsmadi/nix/commit/686a596fa8c9b71dfb4938005632bba553608b5a)
    - [Nix Windows validation harness #1](https://github.com/nix-windows/nix-windows-demo/pull/1)
    - [Nix Windows libstore implementation](https://github.com/awsmadi/nix/tree/feat/windows-builder-parity)
    - [Nix recursive Windows implementation](https://github.com/awsmadi/nix/tree/feat/windows-recursive-nix-master)

Public work / Implementation trail

## Inspect the work behind the result.

Open the working code, review discussions, exact changes, and documentation behind each part.

I've written about this work on LinkedIn as well: [Bringing a Windows builder into the build graph](https://www.linkedin.com/pulse/bringing-windows-builder-build-graph-madison-hope-steiner-cissp-apicc/) follows the build example from cmd.exe to a registered executable in the store; [Windows paths need more than separator replacement](https://www.linkedin.com/pulse/windows-paths-need-more-than-separator-replacement-steiner-cissp-7ogdf/) covers drives, UNC shares and device roots; and a shorter post on the setEnv fix asks [what becomes possible when a return convention aligns cleanly across callers](https://www.linkedin.com/feed/update/urn:li:activity:7504215040619753472/).

What changed

Integrated

### A minimal Windows derivation builder and whole-project cross-build coverage are available upstream.

Implemented

**Where this work lives**

**Available now**
Available in the upstream Nix project.

**Integration**
Merged upstream in Nix #16347 and #16368.

**What supports it**
Build-path implementation backed by project-wide cross-build coverage.

[Nix #16347, Windows derivation builder](https://github.com/NixOS/nix/pull/16347) [Nix #16368, whole-project Windows cross-build](https://github.com/NixOS/nix/pull/16368)

What changed

Available in public branch

### The Windows runtime extends through libstore assurance, content-addressed outputs, and recursive Nix.

Implemented

**Where this work lives**

**Available now**
Available in the public fork and linked pull-request branches.

**Integration**
Implemented in Nix #16411 and #16414 and available from the linked public fork.

**What supports it**
Validated through a separate Windows checking path.

[Nix #16411, Windows libstore gate and output semantics](https://github.com/NixOS/nix/pull/16411) [Nix #16414, recursive Nix on Windows](https://github.com/NixOS/nix/pull/16414) [Nix Windows validation harness #1](https://github.com/nix-windows/nix-windows-demo/pull/1) [Nix Windows libstore implementation](https://github.com/awsmadi/nix/tree/feat/windows-builder-parity) [Nix recursive Windows implementation](https://github.com/awsmadi/nix/tree/feat/windows-recursive-nix-master)

What changed

Integrated

### Unix and Windows callers share an explicit contract for which process handles a child inherits.

Implemented

**Where this work lives**

**Available now**
Available in the upstream Nix project.

**Integration**
Merged upstream in Nix #16449 on September 20, 2026.

**What supports it**
Portable closeOnExec handling with platform-specific implementations behind a common interface.

[Nix #16449, portable process handle inheritance](https://github.com/NixOS/nix/pull/16449)

What changed

Available in public branch

### Windows filenames survive conversion intact, and recursive build connections have coordinated shutdown.

Implemented

**Where this work lives**

**Available now**
Available in the linked public implementation branches.

**Integration**
Implemented in Nix #16451 and the linked public revisions; #16453 defines the network-isolation settings contract.

**What supports it**
Focused path and process tests. Network-isolation settings reject unsupported backends; they do not implement a Windows sandbox.

[Nix #16451, lossless Windows filenames and network paths](https://github.com/NixOS/nix/pull/16451) [Nix #16453, explicit Windows network-isolation contract](https://github.com/NixOS/nix/pull/16453) [Nix, coordinated recursive-build shutdown](https://github.com/awsmadi/nix/commit/05b5212724336d8625adb91c471ea4ac221aca96) [Nix, Windows socket conversion and inheritance](https://github.com/awsmadi/nix/commit/686a596fa8c9b71dfb4938005632bba553608b5a)

Continue exploring

## Compare the decisions across systems.

Move to another result, or return to the complete work collection.

[Explore all work](https://mh0pe.github.io/work/) [Read my philosophy](https://mh0pe.github.io/method/) [Follow the public work](https://mh0pe.github.io/proof/)
