Hacker News new | ask | show | jobs
by giancarlostoro 1541 days ago
I mean to try it but some of these version managers work on Windows too, I believe Nix is specific to Linux. Lorri sounds amazing though! It's the kind of thing that made me fall in love with solutions such as virtualenv (which handles the "this directory needs these specific packages" installed locally, not globally problem that Debian gives you).
3 comments

One thing that differentiates nix from things like virtualenv is that each (package + version) tuple exists at most once in your local nix store and is then linked into your project environments, while virtualenv will install new copies of the packages. On the other hand you have to run the nix garbage collector to get rid of unused packages.

As for Windows support: It seems to be possible to use nix in WSL [0] but I've never tried that. I have used nix alongside apt and pacman on Ubuntu/Arch before I decided to go all the way and install the NixOS distribution. Using it alongside other package managers worked really well.

[0]: https://nixos.org/download.html#nix-install-windows

I've been running nix on wsl and works really well
> I believe Nix is specific to Linux

I've used Nix on Linux (i686, x86_64 and ARM), macOS and Windows (WSL2). I believe it also works (although not officially supported) on BSDs, etc. too, although I've not tried that yet.

> Lorri sounds amazing though! ...which handles the "this directory needs these specific packages" installed locally, not globally problem that Debian gives you).

You're describing Nix, not Lorri. Specifically:

- nix-shell provides a directory-local environments (and more, e.g. #!nix-shell to fetch script dependencies automatically)

- direnv can enter/exit this nix-shell environment when cd-ing in/out of a directory

- lorri makes direnv+nix-shell faster, by building the environment asynchronously in the background (rather than causing our terminal to freeze)

I believe Nix works on top of WSL. And IIRC, it can even handle building Windows GUI exe's, though that may be mistaken.