Live data from Hacker News

What is Nix and why you should try it

yakking.branchable.com

111–120 of 201 posts

Re: What is Nix and why you should try it

#111
I switched from Arch Linux to NixOS last year and it was a great experience https://ramsdenj.com/2017/06/19/switching-to-nixos-from-arch.... The community is relatively small and easy to get into, with lots of people ready to help out beginners.

It took a while to get used to, especially considering the way to learn how something works seems to always be to go and read source code on GitHub. There are good things and bad things about this approach but I fear it makes it difficult for your average user to use since it is a bit of a barrier to entry.

I loved how extensible the system was, and how easy it was to make modifications simply by modifying configuration.nix. It made it really feel as though my system was truly 'mine', in some ways being similar to the feeling I get from setting up an Arch machine. Being able to just recreate a machine by cloning your configuration onto the new machine, and running 'nixos-rebuild switch' is extremely powerful. Being able to roll back machine is also amazing. Something else that really impressed me was how great though ZFS support was. Setting up a ZFS system on Nix is one of the best experiences I've had using ZFS on Linux. It really feels as though ZFS is a first-class citizen on Nix, not something tacked on top. It's possible to set up ZFS without adding any sort of external repository like with Arch.

I ended up leaving NixOS after running into an issue that I would get related to UEFI, and at that point didn't have the time to track down the problem, but I'm really excited for where NixOS is going in the future, especially when declarative user environments https://github.com/NixOS/nixpkgs/pull/9250 (user configuration) with NixUP becomes a thing. I will definitely be coming back to it in the future.

Re: What is Nix and why you should try it

#112
post #57
post #19

I can vouch for the immense improvement Nix has made to my software development process. I use NixOS on my desktop and laptop. At the OS-level, it gets a lot of things right: reproducible, immutable system configs; lightweight containers; devops with declarative configs. At a software project level, nix-shell is an indispensible tool. Compilers and interpreters aren't even part of my system-wide config; instead each…

Naive question: Isn't all that also true for Guix? If so, why do your prefer Nix over Guix?

Guix explicitly rejects non-free software.

Unfortunately, that isn't workable for most of us.

Re: What is Nix and why you should try it

#114
I'm a big fan of Nix, but I really with there was a declarative way to define a user's environment similar to what NixOS has with /etc/nixos/configuration.nix.

It seems a little strange to me to have a functional package manager, but an imperative package install process. I think there are a few projects like NixUP and home-manager that are looking to address this, but I'm hoping Nix will provide an official way to do it.

Re: What is Nix and why you should try it

#115
I recently wrote a blog post about how we use Nix at Pinterest (just the package manager, not the OS). It helps us give all developers and CI an identical environment. On iOS, we run most build commands and other tools through the nix-shell. New engineers set up their environment by just running a script that installs nix and enters the shell.

https://medium.com/@Pinterest_Engineering/continuous-integra...

Re: What is Nix and why you should try it

#116

I'm a big fan of Nix, but I really with there was a declarative way to define a user's environment similar to what NixOS has with /etc/nixos/configuration.nix. It seems a little strange to me to have a functional package manager, but an imperative package install process. I think there are a few projects like NixUP and home-manager that are looking to address this, but I'm hoping Nix will provide an official way to d…

It's coming: https://github.com/NixOS/nixpkgs/pull/9250

Re: What is Nix and why you should try it

#117
post #57

Earlier quoted context omitted.

Naive question: Isn't all that also true for Guix? If so, why do your prefer Nix over Guix?

Guix explicitly rejects non-free software. Unfortunately, that isn't workable for most of us.

Ouch. Is this at a legal or community level?

Re: What is Nix and why you should try it

#118
post #91

Earlier quoted context omitted.

You could use nix the same way guix uses scheme. The lowest level operation in nix is not "run-this-bash-script" but "run- this-executable-with-these-arguments".

But even still you are mixing languages, so the problem remains. The issue is not that Nix uses Bash, but that Nix uses different languages for the host-side and build-side. AFAIK people aren't writing the build-side code in the Nix language, and I'm not sure if it even has the features necessary to do it. Guix unifies the different layers of code execution with a single language, and using a Lisp enabled that design…

> Nix uses different languages for the host-side and build-side.

I'm not sure what you mean by that. Nix packages are Nix expressions.

Re: What is Nix and why you should try it

#119
post #71

Earlier quoted context omitted.

One great approach is the Hoogle search engine for Haskell [1]. The idea with that is that you search by type, instead of name. So if you were looking for a function to take a item, and return a list with n copies of that item, you would search for `a -> Int -> [a]`, which would give you back replicate. Looks like the Nix expression language is untyped, so this wouldn't work directly, but maybe adding a rough type si…

Some Smalltalks (Squeak and Pharo) have a wonderful tool called a "Method Finder". The way it works is you write a sequence of arguments and an expected result , and it suggests a method to call. For example, I just now tried it, entering 3. 4. 7 in the input. It suggested the following methods: 3 + 4 --> 7 3 bitOr: 4 --> 7 3 bitXor: 4 --> 7 Clicking on any of these opens a browser on the class and method concerned.…

That's pretty cool. Is the technique for this documented somewhere, or do I have to read the Squeak or Pharo source?

Re: What is Nix and why you should try it

#120
post #59
post #39

Earlier quoted context omitted.

This is also what keeps me away from Guix. I get that there are third-party repos with non-free software, but using a fringe package of a fringe packager is too far for me. There’s no good choice here: Nix package definitions and tools are inscrutable and user-hostile; and the alternative Guix is burden with GNU/free software zealotry and GPL. A somewhat comparable third option is Habitat, from Chef. It also has a pu…

What kind of non-free tools are you missing from Guix? The only notable omission is linux, as Guix is based on linux-libre instead. But changing this is a matter of 1 LOC.

> But changing this is a matter of 1 LOC.

And how difficult is it for a new user to find that line?

Post reply on HN