Hacker News new | ask | show | jobs
by altgans 1712 days ago
I switched to NixOS half a year ago. The reason? I fell in love with literate programming (I use [1]); being able to write (and read) your whole OS configuration is the dream!

There are few bad sides to NixOS though.

The community consists mostly of programmers, which means I am missing some creative tools (mockups, mindmaps, ..). In the future I will be able to provide/build them myself, but it is not a smooth transition from my previous arch setup.

Also the whole documentation sucks: There are three (!) official manuals + the home-manager manual + Nix pills + YT + random blogs where I have to piece everything together.

Still I find NixOS superior to every other OS (windows, linux) I have tried so far. I just feel free and am not afraid to fuck up anything [2], as I can just go to a previous generation when it doesn't boot.

Lastly, I can save my whole config in git and am free to try new tools -- If I don't like them, I just remove their line in my config. No more chasing after random install folders! (Except in home..)

[1]: https://github.com/driusan/lmt [2]: All the "hacker" stuff: kernel modules, network hardening, ...

4 comments

I really like the idea of NixOS, but there not being a single clear guide of how to set everything up (and the messy documentation) is the biggest thing holding me back. I also really don't like wasting so much time on tinkering with my system the way I used to do.

But I'm seeing so much Nix news these past few weeks, I guess it'll be better in a few years!

I think you can get going with little to no knowledge. Setup the system, choose a few cool options and packages, and go rebuild. Simple as that.

The difficulty comes from the advanced topics. Modularizing your setup, writing your own packages, generally going off the beaten path.

I did not do any of that (yet). I will in the future, but I am fine with my low-level setup. One machine, one user. A bit later I moved to Nix Flakes (which is just an additional wrapper file around the previously written config) and added a few overlays.

My trick: I downloaded every single public "NixOS" dotfile repository I could find, and then just used "ripgrep" to find anything I was interested in.

Another cool trick I read is setting up a VM to test a small config and get a feeling for it, and then decide if yo want to proceed.

NixOS' saving grace when it comes to the learning curve is that experimentation is extraordinarily safe, thanks to the declarative config and rollback functionality. If you don't know what you're doing, you can pretty painlessly get away with just fucking around.
Not just that. The ability to enter a sandboxed shell environment, play around with as many packages as you can get your hands on, and then exit back to my clean machine is my absolute favorite feature!!!

SO many times in the past, I'd be concerned about installing new things because they'd break my otherwise pristine developer environment. Yes, rvm/nvm/virtualenv and others help, but they fail to hold a candle to the nix-shell!

>I really like the idea of NixOS, but there not being a single clear guide of how to set everything up (and the messy documentation) is the biggest thing holding me back.

Yeah this part is messy, and why I always disclaim that I had a learning curve of several months to make the transition. However, my system setup is a little more complex than the standard install - mirrored ZFS root drives on dual m.2 drives, with mirrored boot partitions. That wasn't in the docs, needed a blog post to explain it [1].

>I also really don't like wasting so much time on tinkering with my system the way I used to do.

I've found that once you get everything configured to your liking, you spend similar or less time tinkering than on other OS's, just because the entire system config is captured in a single config file now. There's some up-front learning and work required, but after that it's smooth sailing.

[1]:https://elis.nu/blog/2019/08/encrypted-zfs-mirror-with-mirro...

I should add, to be fair to NixOS and the team, that there are three main official documenation sections: Nix, nixpkgs, and NixOS:

https://nixos.org/manual/nix/stable/

https://nixos.org/manual/nixpkgs/stable/

https://nixos.org/manual/nixos/stable/

Anyone looking into transitioning to NixOS should take a leisurely weekend and just read through all three of those first. Being at least familiar with all of what's there will make getting up and running a lot smoother.

>The community consists mostly of programmers, which means I am missing some creative tools (mockups, mindmaps, ..). In the future I will be able to provide/build them myself, but it is not a smooth transition from my previous arch setup.

Any time you need a package that's not in nixpkgs, feel free to submit a packaging request for it:

https://github.com/NixOS/nixpkgs/issues/new/choose (Issues -> New Issue -> Packaging Request)

Especially if you explain that it's a popular tool in the creative community, that kind of thing is useful for the Nix packaging team to be made aware of. Even if someone doesn't package it right away, there's a good chance it will make it into the next 6-month release cycle.

Cool.

I just played around with R the other day and it would use MD too to generate HTML/PDF.

It uses Knitr.

https://kbroman.org/knitr_knutshell/pages/Rmarkdown.html

That sounds like a nice way to do it, too. I heard about it before, but don't know R, so I didn't really consider it.

The reason I chose lmt is that it correctly keeps the markdown language syntax of the code blocks. That means I can put my literate config into my Zettelkasten [1] or [2] and watch it pretty-print in the browser.

There are also literate [3] and org-babel [4], but I don't think they are future proof. .lit is a random format and .org basically requires Emacs+orgmode.

1: https://github.com/srid/emanote

2: https://wiki.dendron.so/

3: https://github.com/zyedidia/Literate

4: https://orgmode.org/worg/org-contrib/babel/intro.html

Do these things work with any programming language? Like, do they still allow for "squiggly lines" (linter/static typing) in the editor?
For lmt/markdown: I believe yes, to the extend the editor allows for it. It is seemingly just like regular mardkown code blocks. I get the correct syntax high-light in the ``` code blocks. I don't have lint/LSP setup yet (currently moving to Neovim), so I can't say anything about that.

Literate/.lit: I don't know, I guess not.

Emacs/orgmode: Yes, this also does syntax highlight. And you can edit the code-block in a separate window as if it was a "real" source code file. I've been using this for almost two years now. Personal opinion: I don't think the benefits of Emacs outweight the cons.

> I just feel free and am not afraid to fuck up anything

Until you have to install the latest NVidia drivers, I suppose.

That's because someone already did the porting and testing for you. But what if you want the latest video and CUDA drivers?
"not afraid to fuck up anything" likely refers more to the ability to rollback the system to any (non-deleted) previous revision of the system configuration, directly from the bootloader, which means you can easily recover even from a broken kernel.

This applies regardless of whether you are packaging/updating something in the package set yourself, or using something that someone else packaged.

> That's because someone already did the porting and testing for you

The same happens on all package managers...

No, you can get the installer directly from the NVidia website, but only for selected platforms. If you're on a different platform, you'll have to wait until somebody ported (read: hacked) the release (or do it yourself).
No, that’s not any harder than anything else.