Live data from Hacker News

What is Nix and why you should try it

yakking.branchable.com

21–30 of 201 posts

Re: What is Nix and why you should try it

#21
post #7

Earlier quoted context omitted.

Guix uses it’s own init system implemented in Scheme: Sheperd ( https://www.gnu.org/software/shepherd/ ) Herd/Hurd is a kernel, not an init system, although since systemd is Linux only, using a different kernel implies using a non-systemd init system.

Shepherd is not a kernel, Hurd is, and shepherd page mentions a relation, that dmd/shepherd was developped closely to Hurd but it not the same thing.

Sure, I wrote herd not Hurd!

herd is the commandname of Shepherd client:

https://www.gnu.org/software/shepherd/manual/shepherd.html

Re: What is Nix and why you should try it

#22

Gobolinux does something similar, and has been around for years: https://www.gobolinux.org/

Funnily enough, NixOS has had its initial release in the same year as Gobolinux, 2003.

I'm not sure how Gobolinux organizes files exactly, but with NixOS, the hash in /nix/store/-packagename is produced by combining every input that might influence the package. By input I mean for example:

- The source: git revision / source url / etc.

- All dependencies, which means if a dependency of a dependency of this package changes, it gets a new hash

- Build instructions, including build flags

This wouldn't be possible with a more conventional file structure.

Re: What is Nix and why you should try it

#23
post #17
post #6

Earlier quoted context omitted.

I think biggest ones are i) nix command is a bit complex, but it's getting redesigned [1] & ii) nixpkg definitions sometimes contain a lot of cruft. I've found Guix and GuixSD, which are a GNU-blessed Guile Scheme-based reimplementation of Nix and NixOS, more aesthetically pleasing. Quite simple and elegant in fact. The major differences are that Guix DSLs are implemented on top of Scheme, whereas Nix uses a custom D…

For my practical reasons I can not use pure GNU distributions, I am not aware of easy community way to re use packages for other distro or something hacky like that. Not everyone have brainpower and time to build custom packages for rare distro, it is a shame, I really like Guix. NixOS got some recepies for using not 100% libre software.

There are repos around packaging tons of non-free (mainly scientific) software for Guix.

Re: What is Nix and why you should try it

#24
post #21

Earlier quoted context omitted.

Shepherd is not a kernel, Hurd is, and shepherd page mentions a relation, that dmd/shepherd was developped closely to Hurd but it not the same thing.

Sure, I wrote herd not Hurd! herd is the commandname of Shepherd client: https://www.gnu.org/software/shepherd/manual/shepherd.html

Ah — confusing as Herd is the second recursive acronym of Hurd... sorry to pedantic :-)

Re: What is Nix and why you should try it

#25
post #11

I recently wrote about my experience using NixOS on my VPS [1]; it's truly a very different way of approaching systems administration and Nix is at the heart of it. While I think the Nix expression language has a negative impact on usability, Nix still ends up being a net gain for not only entire OSs, but also reproducible environments for packages on many other OSs. 1: https://blog.jeaye.com/2017/07/30/nixos-revisit…

Oooh! Thanks for linking this write-up. I've been thinking of playing around with Nix and basically only be able to do it on a VPS.

Before I get started though, what things could I consider implicit prerequisites of running Nix? For example: I've never built a Debian or RPM package. Would I be better served gaining some background in OS package management before diving into this?

Re: What is Nix and why you should try it

#26
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.

virtualenv solves virtual environment as much as pip solves OS package management. Not that it's not useful, but you see all over where you have little fiefdoms that work pretty well for their little ecosystem, but become a mess if you integrate stuff outside (virtualenv, rbenv or pip, npm, gem, rpm, apt or make, ant, scons, jam).

A lot of these systems are just reimplementations tailored to language-X. Nix is pretty unique and clever. For example, you can effectively version control you virtual environment, it's at the OS level, and accommodates major languages and libraries (Python, Perl, Lua, Java, Go, Qt).

Re: What is Nix and why you should try it

#27
post #17
post #6

Earlier quoted context omitted.

I think biggest ones are i) nix command is a bit complex, but it's getting redesigned [1] & ii) nixpkg definitions sometimes contain a lot of cruft. I've found Guix and GuixSD, which are a GNU-blessed Guile Scheme-based reimplementation of Nix and NixOS, more aesthetically pleasing. Quite simple and elegant in fact. The major differences are that Guix DSLs are implemented on top of Scheme, whereas Nix uses a custom D…

For my practical reasons I can not use pure GNU distributions, I am not aware of easy community way to re use packages for other distro or something hacky like that. Not everyone have brainpower and time to build custom packages for rare distro, it is a shame, I really like Guix. NixOS got some recepies for using not 100% libre software.

I was told guix has some support for importing normal Nix packages, but I don't know how well it works in practice.

https://www.gnu.org/software/guix/manual/html_node/Invoking-...

Re: What is Nix and why you should try it

#28
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.

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. Nix is more like a thing to get inspired by to make a package manager.

Re: What is Nix and why you should try it

#29

I have recently started looking into Nix to solve the problem of dotfile deployment to new OSX workstations. When you get a new laptop, you clone your dotfiles, maybe symlink them to your home directory -- and then what? Nix solves this problem for me by coupling my dotfile deployment with the installation of the related software. The learning curve has been absolutely tremendous, however. That said, the support on F…

Nice. I started using macOS 5 months ago and it felt a bit as a step back coming from Linux.

Does Nix work good with macOS?

Re: What is Nix and why you should try it

#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.
Post reply on HN