Live data from Hacker News

What is Nix and why you should try it

yakking.branchable.com

41–50 of 201 posts

Re: What is Nix and why you should try it

#41
post #30

I'm gonna need a better reason to switch distros than that. I do think that is an improvement that needs to be adopted in the OS. But, I mean, it's not that much of a improvement over containers. I don't feel like it gives me, the user, that much more power over the OS and would be a feature that I would only use very rarely.

The blogpost just highlights one nice aspect of it, there's more though:

- The really powerful NixOS module system, which let's you specify your system declaratively and rather simply: Which programs should be installed, what systemd services should run, use grub for booting, allow this ssh key to login to this user, enable the IPFS daemon, etc. All options (for the 17.09 release) are available here: https://nixos.org/nixos/options.html

- System generations: Upon changing an option in your system config, you run `nixos-rebuild switch` which will build, activate the new system and add it to the system generations. All of these are bootable from your bootloader! So if something breaks miserably, you can just rollback to a previous one that worked. New kernel breaks on your hardware? No problem, just roll back.

- If you have a new nixos machine, you don't need to run a bunch of odd commands to have it set up. Since the config is declarative, everything you set up is right there, and all you need is a `nixos-rebuild switch` to make it work.

- Wanna test some configuration but are too afraid to use your machine? Just build a VM with it by doing `nixos-rebuild build-vm`. Like with everything else with nix, this fetches all dependencies, no need to install them manually.

Re: What is Nix and why you should try it

#42
post #4
post #2

Nix is pretty cool but has some significant usability issues.

Having never used Nix before, I would like to know what kind of usability issues it faces. For me, the biggest one is that I can't use it at clients running a Windows shop. That's a blocker.

It apparently works in WSL [1], so Windows needn't be an issue.

[1] https://www.reddit.com/r/NixOS/comments/64xyd7/nix_package_m...

Re: What is Nix and why you should try it

#43

That article on "What is Nix and .. " does not contain the words "Nix is a..." A quick read gave a vague sense that it was about installs and file paths so maybe something package-related? Nothing definite. If you click through to https://nixos.org/nixos/nix-pills/why-you-should-give-it-a-t... you will see "Nix is a purely functional package manager and deployment system for POSIX"

Yes I recommend the nix pills they are really awesome and how I learned Nix!

Re: What is Nix and why you should try it

#44
post #42
post #4

Earlier quoted context omitted.

Having never used Nix before, I would like to know what kind of usability issues it faces. For me, the biggest one is that I can't use it at clients running a Windows shop. That's a blocker.

It apparently works in WSL [1], so Windows needn't be an issue. [1] https://www.reddit.com/r/NixOS/comments/64xyd7/nix_package_m...

Do you use Windows 10 Creators Update on production? It needs to work on Windows Server 2012 or no dice. Maybe Nix will be an option in 5 years when companies upgrade their servers, but that's not an option now.

Re: What is Nix and why you should try it

#45
post #33

My experience with Nix was a real pleasure, and a complete failure. I set out with the goal of building a development environment for a software I was working on. I thought - Nix sounds like a better Docker, where it's possible to choose package versions independently of the rest of the system. It's perfect for testing! I found the package description language refreshing - it was powerful without getting too complica…

Although other people have different opinions to me, I don't really see Nix as something for the desktop, but for development, deployment and server software it's a killer solution for me.

Re: What is Nix and why you should try it

#46
post #18

Python solves this problem with "virtualenv", where the user creates a virtual environment and installs all programs and libraries into that environment. The user can have multiple virtual environments, and it is easy to switch between environments.

venv doesn't even handle environment variables. Some environment that is :p

Re: What is Nix and why you should try it

#47

Recently, I got the opportunity to play with Nix. To me, it felt to be a very nice way to bundle the dependencies along with the application. But there are few questions which always come to my mind were - how people run it in production. Can they achieve all the things (eg monitoring, debugging..) easily just like the app hosted on a linux machine ?

Sure? It’s still Linux underneath and all the same skills and strategies carry over.

Re: What is Nix and why you should try it

#48
We used Nix to vastly simplify the build process of Simula: https://github.com/SimulaVR/Simula

Simula is a bleeding edge VR Desktop project for Linux; virtually all of its dependencies are highly novel and require building from source for almost any distro. Nix allowed us to reduce the effort to building our project from 1hr of sifting through build documentation to a single build command.

Nix's only issue is that it so far can't handle OpenGL dependencies very well. I'm not sure if this is something in principle it cannot handle, or if it just hasn't been done yet. I'm praying it's the latter.

Re: What is Nix and why you should try it

#49
post #33

My experience with Nix was a real pleasure, and a complete failure. I set out with the goal of building a development environment for a software I was working on. I thought - Nix sounds like a better Docker, where it's possible to choose package versions independently of the rest of the system. It's perfect for testing! I found the package description language refreshing - it was powerful without getting too complica…

Gah! My story is pretty much exactly the same.

Re: What is Nix and why you should try it

#50
post #28

Earlier quoted context omitted.

Discoverability is a problem everywhere in Nix, from configuration options to documentation. Which makes it necessary to learn its weird poorly implemented functional programming language and read code. Then there is performance, it's very slow and uses a lot of memory making it impossible to use on a 512 MB vm, for example. If you just want a solution for your packaging management needs - Nix is definitely not it. N…

That's nice to hear you say, because I am making a package manager, and I find nix inspiring :p I keep trying to convince myself that someone's already done it better, and there's no point, but then every solution I look at doesn't seem to be good enough.

Agreed, it’s an area where nothing is quite there. Take a look at Habitat - another not quite there option, but one with interesting ideas.
Post reply on HN