Nix on Windows?

OK some progress updates:

Ready/merged:

Next major milestone:

22 Likes

Two more PRs split out from Build unit tests with MinGW by Ericson2314 · Pull Request #8901 · NixOS/nix · GitHub

7 Likes

I’d also like to thanks @wegank a lot for helping out with getting readline working on Windows, so we can (hope to) have a nix repl. That is the final dependency that needed Nixpkgs porting help (since we are skipping lowdown for now).

The number of Nixpkgs PRs and backports for this is rather dizzying, so I won’t link them here :D.

16 Likes

There is now a matrix discussion channel for this effort #windows:nixos.org!

(@Ericson2314 is rate-limited in this thread, and so asked me to post this message on his behalf.)

2 Likes

Thanks @Qknight!

The first big news since that has happened is that @puffnfresh made some further progress: Brian McKenna: "Now got a #nix-instantiate.exe - ending my work t…" - Mastodon and previous posts.

17 Likes

This looks like great starts…
Do we have a project github where we can share on this?
e.g.
- Considering system packages/features (terminology changes between workstation and server versions for no good reason via DISM.exe)

  • Pursuing is (beta/preview) M$/Pwsh DSC (Desired State Configuration) becomes useful enough to add to Nix on windows.

Thanks!

There is

A little confused, but GitHub - PowerShell/DSC: This repo is for the DSC v3 project sure that is worth knowing about. I assume this is more an ansible/chef/puppet type thing?

2 Likes

I think maybe she’s excited about the possibility of an impure Nix module system for Windows, like Nix-Darwin is for macOS, where the parts that require configuring the underlying OS could rely on DSC.

But yeah, DSC is like Puppet or Chef. It’s an interface for defining configuration options that can be invoked declaratively, but it’s basically powered by bits of PowerShell scripts and it’s on the authors of DSC modules (or whatever they’re called) to ensure those scripts behave idempotently.

5 Likes

And thanks for the nix-darwin comparison. I get it better now.

1 Like

Thanks for the clarification I was also confused but this makes sense.

And thank you for your work everyone! I’m very excited for the doors this will open, even if I don’t use windows myself. Godspeed!

6 Likes

We have a beachhead, Build a minimized Nix with MinGW by Ericson2314 · Pull Request #8901 · NixOS/nix · GitHub is merged!

With that, the work can hopefully proceed in parallel. To kick things off, I’ve opened issues:

Some of them are quite small and self-contained and would be excellent first issues for new contributers!

40 Likes

wait, wasn’t Moby Dick a sperm whale :wink: this is great news - is there a “quick start” for someone having never done it to get what you’ve accomplished setup on Windows? I can fumble around in the dark but probably won’t find it. Anyway, very exciting.

1 Like

@Qknight posted libnix mingw status just before it was merged, which has some instructions for trying things out.

Of course, we’ll want to make it easier and better tested next!

10 Likes

Nix is going to eat the world! This is huge!

11 Likes

Thanks for this! I got stuck but will try again soon

1 Like

so I finally got around to reading chapter 36 and Moby Dick is a “white whale” indeed and this I found I had to share −

If man will strike, strike through the mask! How can the prisoner reach outside except by thrusting through the wall? To me, the white whale is that wall, shoved near me. Sometimes I think there’s naught beyond. But 'tis enough. He tasks me; he heaps me; I see in him outrageous strength, with an inscrutable malice sinewing it (p. 267)

Still haven’t got nix working in Windows (following Qknight post get an error when I go ahead and :b packages.x86_64-linux.nix-x86_64-w64-mingw32 but no worries. As Ahab says “God bless ye” for working on this. Good things are coming

9 Likes

Another thing passing by my mind:

With some luck we can include Nix on ReactOS as a free platform in the foreseeable future!

10 Likes

libnix volth's work summarizes volth’s windows nix port work and some parts of the discussion in this discourse.

9 Likes

libnix fixPath - fixPath is a tool to modify the path to a certain DLLs (Dynamic Shared Objects) for Microsoft Windows Executables by rewriting parts of the executable’s PE header, when the .fixPath section is present and indicates support for such rewrite, but without having to realign the PE headers. In concept, it is similar to patchelf but instead of changing search paths, fixPath hard-codes each DLL to a particular filepath.

see fixPath project page:

https://github.com/nixcloud/fixPath

release with prebuilt fixPath.exe tool + test program:

https://github.com/nixcloud/fixPath/releases/tag/v0.1.0
17 Likes

libnix roadmap contains a summary of items we need to get done in order to port a minimal nix to windows and use cargo cross platform to utilize the /nix/store instead of ~/.cargo and target/ folder.

10 Likes