Documentation and/or examples for usage of pkgs/build-support/vm/windows?

Hi there,

while studying nixpkgs i have found this here: History for pkgs/build-support/vm/windows - NixOS/nixpkgs · GitHub
…and this looks highly interesting for a few things that i wanted to achieve with windows automation.

Unfortunately, i am neither a windows expert, nor is there any documentation or examples that i could find about this nixpkgs folder.

From reading the code, i understand that i need a specially prepared windows image that installs itself without further input, and after the whole procedure i have some windows vm with cygwin installed that i can use to execute nix expressions in, is that correct?

And if it works like this, i have more questions:

  • Are there any users here who could explain how they use it?
  • Which Windows versions does this work with, or will this simply work with any windows version you can create an unattended install image with?
  • Where to get/How to create such unattended images? What material/tutorials do i need to study in order to be able to create such images, too?

In the git history it says that @aszlig wrote most of this - is this still in active use?

Best regards

2 Likes

Sander van der Burg's blog: Deploying .NET applications with the Nix package manager was written in 2011 before .NET was OSS/x-plat.

See if this gives you some clue as to how to do things.

1 Like

Thank you @SRGOM, i studied the article. It looks like sander used nix directly on a windows machine in cygwin. This is very interesting, too, but i was more looking into automatically installing windows in VMs on a nixos machine in order to have VM images that i can then further fabricate into reproducible images for other purposes.

I wrote this years ago when I was writing the Nix build pipeline for a game and it was intended for running automated tests since we were cross-compiling to Windows back then and needed to make sure that the build result actually works on Windows.

Not sure whether the implementation still works, because I’m no longer involved with that project and thus haven’t had a use case for this afterwards. IIRC something like Windows 10 isn’t supported but support for it could be added by adding an answer file similar to this.

This commit message has a small usage example:

https://github.com/NixOS/nixpkgs/commit/b5de8156cb64fd873e27e0ef3d26925c17ee0cd5

1 Like

@aszlig thank you for pointing me to the description, this does help a lot! I think it might be worthwhile to have it in readme files that are located next to the actual nix expressions.