Live data from Hacker News

NixOS Linux

nixos.org

61–70 of 82 posts

Re: NixOS Linux

#61
post #46

I'd love to try Nix. But, I'm using an Nvidia Jetson environment, which is based on a preinstalled Ubuntu 18.04, probably with lots of specific driver configurations that I don't want to touch (or reinvent). I've also learned that running Nix on top of Ubuntu is not the greatest idea, see e.g. [1]. [1] https://news.ycombinator.com/item?id=16443323

A mildly insane possibility would be to install lxc and then use a system container to play with nix in.

Re: NixOS Linux

#62
post #50

Earlier quoted context omitted.

Has the container situation improved? Last time I looked (quite some time ago) I couldn’t find an official or community blessed container to base anything on.

I've used the nixos/nix image from Docker Hub[1] to run some CI scripts using Nix to build my projects. As far as I understand it, it's basically Alpine Linux with the Nix package manager and tools preinstalled, but it worked pretty well for me. [1]: https://hub.docker.com/r/nixos/nix/

This is the sort of thing I was looking for. There may not be much too it, (and as another comment mentioned, the package management tools can output containers) but having a blessed starting point shows a clear signal to potential user that it's not just an afterthought.

Re: NixOS Linux

#63
The last time I looked into Nix (a few years back) the expression language was very under documented which made it very difficult to use (e.g. searching for lots of examples to copy paste, instead of working from first principles). Has this gotten better?

Re: NixOS Linux

#64
post #14

Earlier quoted context omitted.

> Using a special command (nix-shell) whenever I needed to do development things (e.g. Rust builds) was not my idea of fun. Funny you should mention that, because that's exactly what got me using Nix everywhere :). I've always hated installing tools and libraries globally—what if I need a different version for a future project?—so I like tools that sandbox as much as possible like virtualenv, cargo, cabal... etc. But…

Out of interest, how does this work if using something like Visual Studio Code or some other IDE?

https://marketplace.visualstudio.com/items?itemName=arrteria...

Re: NixOS Linux

#65
Nix is a powerful package manager. I can confidently compile and run multiple incompatible versions of software simultaneously. I can build projects from years ago. I can package large projects from different ecosystems (python 2/3, c/c++, go, Javascript, Octave, Rust) and be confident they will not interfere with each other. I can try bleeding edge software with no risk to it interfering with my system. It is faster and less hassle than juggling various Docker containers and VMs. It protects me from dependency hell. Using Nix to manage an operating system (ie: NixOS) then gives me those benefits for my entire machine. Then I get even more benefits when using Nix on any other (not even necessarily NixOS) machine by pushing around package closures and managing a simple binary cache.

But overall: it makes me more productive. It is my secret weapon to manage the complexity of software development.

Re: NixOS Linux

#66

I played with NixOS and am willing to admit that it was too difficult. It's probably great for devops, but it's just slightly too rigid for my own personal use. Let me give an example: let's say you want to use xmonad on top of Plasma. NixOS doesn't have any simple way to configure that. You have the mutually exclusive options for one or the other, basically. I know Nix is powerful enough to do this, if I wanted to g…

Don't bother with NixOS then. Just use the nix package manager on Arch. You get declarative package management with nix shells, and you can take that configuration with you to any linux distro, or even macos.

I think it's fantastic that we have a declarative, deterministic, idempotent package manager that works across all these OSs. I've used it happily for years now without ever bothering to try NixOS.

Re: NixOS Linux

#67
I read most of the comments up to this point and was surprised that no one has mentioned how the system config is versioned, and the boot loader allows you to select from past builds, making it incredibly easy to recover from config issues (and thus also easy to experiment with different configs without fear of having to waste hours recovering a certain state).

Re: NixOS Linux

#69
post #56
post #2

Just to see if I understand, does this mean you might end up having dozens of libcurls?

Not repeating the others: If a package does end up using multiple version of the same lib, nixos can even deduplicate it somewhat, by symlinking one’s documentations to the other’s.

There's an optimzation I'm aware of where nix will de-duplicate individual files with hard links. This wouldn't be safe in almost any other context, but is safe with nix because the files are immutable. So you have have 100 variations of libcurl and only "pay" for the unique files.

Re: NixOS Linux

#70
post #44

Kind of off topic, but I would love to have NixOps ( https://github.com/NixOS/nixops ) as an abstraction layer for every type of cloud service, and not just virtual machines (e.g. queues, object storages, etc). There is Terraform and Ansible, of course, but Nix seems like it could combine the strengths of both of them.

There are actual plugins for AWS, Hetzner, GCP and Azure (on an old version of NixOps) and it's quite easy to add support for your favorite cloud if there is a decent usable API.
Post reply on HN