Hacker News new | ask | show | jobs
by thomastjeffery 3332 days ago
To be clear, Nix isn't haskell. It has its own domain-specific language. The documentation is a total mess, and months into using NixOS, I still don't really understand it.

That being said, NixOS is the best damn OS I have ever used. Period.

Installing NixOS is a total breeze. It's magical.

1. Boot live CD

2. Mount partitions

3. Write a simple configuration.nix

4. nixos-install

5. Boot a complete system, and log in with the user you defined in your configuration.nix (with a hashed password and everything).

nix-env lets you install packages in your home directory (without root).

nix-shell lets you create a special environment with specific packages, etc. and run a shell in that environment.

nixos-rebuild [switch test boot] (as root) creates a new system according to your modified configuration.nix. If you use switch, it (re)starts updated/new services all on its own. If you broke your system, just reboot, and pick the second most recent boot entry, and you will be back where you started.

TL;DR NixOS is well worth the effort. The benefits far far outweigh the headaches, and there is only room for improvement. You will start with a system that you cannot break!

3 comments

While I agree with most of your comment and am writing this on my NixOS desktop, installing is a breeze only if you don't want to encrypt your root partition or don't want to use it on a macbook or something that mature OS'es usually do quite nicely out of the box.

I have my bookmarked set of gists to guide me through these things and it took me days to get it right the first time.

Also nixpkgs are a bit of a mess, you usually get a version of a package someone has bothered creating a PR for. This might be very old or bleeding edge. For specific versions you can be SoL. It is of course fairly easy to have your own .nix of the package and PR's are usually accepted quickly but the repo usually doesn't keep previous versions.

And then there is a whole world of pain regarding language specific packages. Python is especially painful for me.

It took me ages to find the page which hints at nix-shelling projects but this is a pita and requires a completely new workspace setup that is not compatible with people that don't use Nix.

Regardless I love NixOS, but to say this is perfect, not even close.

Please stop saying the documentation is "total mess" and "absolute shit" because this is far from the truth. There is comprehensive documentation available for Nix[1] and NixOS[2]. There is an online search for packages [3] and NixOS configuration options [4]. Sure the documentation will be incomplete in places but that doesn't make it "absolute shit", I have found it to be very helpful generally.

[1] http://nixos.org/nix/manual/

[2] http://nixos.org/nixos/manual/

[3] http://nixos.org/nixos/packages.html

[4] http://nixos.org/nixos/options.html

Comprehensive is not the same as user friendly, or well paced, or organized in a way that will assist new people learning.

I've seen plenty of projects that were exceptionally well documented. Every method and class had inline docstring documentation, every module has a separate module docstring block. 100% PEP 257 compliance was enforced as part of the CI tool chain... helpful but only after I was sufficiently knowledgeable about the way the project was being used to get any benefit from it. The the sheer volume of documentation meant that many people had written extremely terse explanations, often devoid of any of the contextual information that would significantly improve someone's understanding of how the code in question was be used.

Point is... The volume of documentation or the percentage of documented features, has no direct bearing on its usefulness to any particular user.

The docs are terrible.

I was personally donating monthly to Nix foundation for past few years, the maximum amounts that don't trigger tax concerns, but finally pulled my funding after the team continued to bury their heads in sand about state of docs for newcomers.

The main site docs are incomplete and reference style. The Wiki which had some use cases also had a banner saying it was all deprecated.

So you get newcomers who can't orient themselves, and even advocates like thomastjeffery in this thread who love it but months in still think the docs are wildly unhelpful.

Interestingly, guys who understand it very well are no longer capable of seeing the problem. They forgot what it's like to have no idea how any of it works, so can't describe the happy path between ignorance and the lightbulb coming on -- or even see that path isn't lit.

For now, the only way to walk that path is either absolute focus on learning it w/ no time for a day job, or have your hand held by someone enlightened (which is expensive for your MVPs compared to fixing the docs).

Like I said, after months of using NixOS, I do not understand how to write a simple Nix expression.

Where is this explained?

I am speaking from experience when I say the documentation is "absolute shit". Most of the useful documentation I have read comes from the deprecated wiki.

When I first installed NixOS, I had to read the source code for simple things like defining a user or getting samba set up, and still had to rely on the deprecated outdated wiki.

Three current state of documentation for NixOS is spread between the manual, deprecated wiki, and the source code itself. The manual barely shows how to get a simple system working, but as soon as you reach an edge case - which Nix itself is fantastically suited to handle - you have to start digging.

In time, documentation for NixOS will be mature and usable, but right now it is severely lacking, moreso than any other aspect.

Hmm. Alright then, I'll keep it in mind.

One question: can I remove systemd? :)

It may be worth mentioning, if you want to avoid systemd, that Guix has a Scheme-based init system called Shepherd:

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

Oh TIL, thanks. Nice name :)
AFAIK, NixOS relies heavily on systemd.

Any particular reason you don't want it?

I guess not. I'm just still running Slackware, so I haven't needed to grapple with it just yet - and I'm holding out hoping to find that one other distribution that also doesn't use systemd so I can use that instead. :P

I've heard good things about Void Linux, I'll likely have a look at that at some point.

On the flip side of the coin, I've kind of accepted that everyone who uses Linux has to put up with systemd now, so I'll accept my fate eventually. It's just that I value constructive and positive communication, I don't like the systemd team's blatant arrogance, and I consider it a corporate abuse of power that nothing has been done to curb or deal with it. (I hope I never have to deal with Red Hat in a business setting. Feathers, sparks, fur... everything would fly, and it wouldn't be pretty.)

As far as I can tell, the general hatred and fear of systemd is overblown.

I have never had an issue with it. In fact, systemctl has been much more consistent for me than init services ever were.