I am working on changes that would likely break any remaining support for Cygwin, and there is no way to build or test Nix with Cygwin. It is not in the list of supported platforms.
I am trying to add support for native Windows (using mingw-w64).
I donāt think it is currently used by anyone, so some breakage might be okay. However, we definitely want to make it easy for someone to readd support in the future. In theory it should be much easier to support than mingw-w64 & require less patching, but itās not used very much any more with WSL available.
In our company we use every day nix on cygwin since years. Some months ago I also reported a bug in nix 2 that got fixed, and since then we use the latest nix just fine.
Of course we use it with non-public nix expressions that involve Microsoft compilers and so on.
Please donāt break nix on cygwin.
On the other hand, we welcome a native nix for Windows too.
Thatās pretty impressive. Do you have any articles or documentation about it?
Iām specifically interested on how to build, install and run Nix on Cygwin. I would also love to know how youāve integrated it with VS and how well it works compared to other build and packaging tools or compared to Nix on WSL.
Sidenote: I feel like removing support for something is basically guaranteed to decrease portability?
I.e. you WILL end up with something that doesnāt port eventually.
As there are some Windows users, what do you think about adding support the drive letter to the Nix Parser when it parses paths?
I filed an issue 6 months ago https://github.com/NixOS/nix/issues/2603 and get no reaction, concluding that noone cares about Windows or Cygwin.
Ah no I donāt have any public example. Our nix files are pretty simple though; we basically have a replication of vsvars in bash syntax, and we try to support multiple compiler versions, SDK versions, ucrt, etc. To have some reproducible results on fixed nix hashes, at least.
But we donāt build nixpkgs with those recipes; only the libs/programs we use for our development. Nothing special - some open source mathematics and i/o libraries. We even donāt use nix-shell for the development environments but we have recipes for scripts that behave like nix-shell.
By now cygwin nix has been enough so I never cared about the non-unix paths. But some colleagues have a desire for a cygwin-less solution because the programs run faster in either WSL or native windows, and then this may have a role.
Itād be nice that a cygwin nix could evaluate the same kind of recipes as a mingw nix, and the paths worked just fine, not requiring different recipes. The same way one can use git for mingw or git for cygwin, in a windows machine.
EDIT:
1st time I use this discourse, and created an account only to answer this topic. It says I reached the limit of Replies in this topic and that I should edit my previous replies instead. The last nix we use 2.0.x doesnāt need libeditline. So maybe someone broke the normal cygwin build by adding that.
Sharing the same store between Cywin, WSL (and a potential native Nix) sounds like a great idea. I might give it a try, but I canāt think of a maintainable way to get either symlinks or GC to work correctly.
How do you build Nix on Cygwin, without Nix? I was not able to get the latest tarball to build: ./configure doesnāt find libeditline and doesnāt recognise libreadline
I have native Nix fork at https://github.com/volth/nixpkgs-windowshttps://github.com/volth/nix-windows (with MSVC and Perl as stdenv.shell because there is no bash working properly with Windows path names, all bashes require some sort of FHS emulation (moreover there no perl nor coreutils working properly with Windows long paths, build process of some native program use long paths which stdenv has to me able to cp -r and rm -rf at least). Perl + some 3rd party modules Win32::LongPath + patches not accepted by upstream was the closest shell to support all kinds of paths. Perhaps I had to use Powershell.
It builds Perl, Python, LLVM, Chromium, Win64Dbg, ā¦
Mingw binary packages can be unpacked to c:\nix\store as-is, without recompilation or patchelfāing, there is an updater script for them.
My goal was mainly to build Chromium with native Windows font rendering (free of freetype ugliness), so the development is stuck after the goal was achieved.
@volth That is amazing work! I would love to use it and complete it to make it easier to merge upstream (if thereās enough support for it). I see thereās a few bugbug/??? comments and no symlinks. I had been considering a busybox-w32 + clang-cl stdenv.
I was able to build on Cygwin, using -lreadline -DREADLINE. Iām working on getting some of the tests to work. Iāll try to figure out what other dependencies I needed so I can write some docs.
The big refactoring needed in upstream is replacing Nixās class Path with something character-size (char or wchar_t) and delimiter (/ or \) agnostic, for example boost::filesystem::path.
It is what is difficult to solve by #ifdef _WIN32, because Path is everywhere.
That issue above was supposed to be the first step
I was installing nixos at the end of last year.
While using Windows or another Linux.
the early summer months of this year
We used nixos in earnest.
The reason for the initial use is that regardless of the companyās development date, the duration of the re-recovery when formatted and the integration of internal complex developments is simple, so I became a full fan.
Company work is webgl of Unity3d, I came back to Windows a few days ago (I already had a Windows disk, I used to use multiboot, but only nixos).
Now I accidentally blew up a nixos disk.
(Because I was baking iso from msys2 to dd in usbā¦) It occurred.)
So, I was a bit out of my mind, but I came to my senses.
.
I installed nix + home-manager on wsl2 in this opportunity.
It was okay, butā¦
It was not as simple as nixos configuration.nix.
because
I like to customize it myself.
And
I like to set everything in one setup file. Especially for me.
You do not use the nix-shell repl, and you may not know how to use it.
The style to change settings and rebuild.
.
The nixpkgs-window that @volth have successfully installed and succeeded in this opportunity.
I want to try it on msys2.
.
How do I get started?
I donāt know perl.
Some thread Windows MinGW support Ā· Issue #1320 Ā· NixOS/nix Ā· GitHub
tells you you use a perl. I wonder When installs nix on the window, perl why and where need.
That PR adds Cygwin as a cross-compilation target, with enough to cross-compile a working bash.exe program. Iām hoping it could be useful for a stdenv on Windows.
I canāt see any recent release of Nix being available in a Cygwin environment so I would vote to get rid of all the existing Cygwin āsupportā from nixpkgs. Hopefully one day weāll be able to even cross-compile a Cygwin version of nix.exe, but until then, the broken stuff just gets in the way.