Live data from Hacker News

NixOS and the Art of OS Configuration (2018)

rousette.org.uk

81–90 of 123 posts

Re: NixOS and the Art of OS Configuration (2018)

#81
post #71

Earlier quoted context omitted.

I'm not asking it to be more 'orthodox', I'm asking to not have to spend months scouring poor documentation to learn a new language and toolchain to gain the very few benefits Nix provides over the existing systems. If Nix is so inherently complicated it cannot deliver that, then why would I want it? Ultimately I want less complication in my life, not more, and Nix very much does not provide that from what I can see.

It is like saying I don’t want spending months to learn git to gain the very few benefits of a version control system. I much prefer to share my code with my coworkers via usb-sticks. Yeah this is less complicated in the short term.

I honestly don't want to learn git precisely because there are version control systems that accomplish the things I need in a much simpler way. I only bother using git at all because some FOSS projects I've worked with use it. Hell, my impression is that most people who use git don't bother really learning it, they just keep a recipe book of how to branch, commit, etc. and then rely on stack overflow to un-fuck the repo after they accidentally blow it up.

Re: NixOS and the Art of OS Configuration (2018)

#82
post #65
post #59

Earlier quoted context omitted.

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. .…

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.

Re: NixOS and the Art of OS Configuration (2018)

#83
post #41

Earlier quoted context omitted.

I always think it's worth mentioning explicitly that NixOS makes it not just possible to put everything including the root file system on ZFS, it makes it completely easy.

It's not unique at that though. FreeBSD has had this for a decade. And Ubuntu is adding it now as an installer option. PS: I do like the idea of NixOS and its USPs which are indeed unique :) For me what's stopping me is the learning curve. I don't mind learning per se but if I put the time in it I'd like it to be for something that's useful in more places. Like ansible.

What's interesting about NixOS' seamless NixOS support is that ZFS can't be included in the Linux kernel, and so that kind of integration takes more work with Linux distributions, so relatively few distros have it down pat.

BSDs don't face that kind of integration challenge, since they can just ship ZFS support directly in their kernels. They have recently faced an integration challenge of their own, though: rebasing their ZFS implementations on OpenZFS (f.k.a. ZFS on Linux).

Anyway ZFS is great and I hope OpenZFS' multiplatform support gets so good it can become popular on Linux, *BSD, and macOS all at the same time. :D

Re: NixOS and the Art of OS Configuration (2018)

#84
post #19

I recently made the switch to Guix, which is a distro heavily inspired by NixOS. It even has a Nix service[1] which is easily enabled to get the best of both worlds. Highly recommended! [1] https://guix.gnu.org/manual/en/html_node/Miscellaneous-Servi...

How do Nix and Guix compare?

(Disclaimer: Guix developer and former NixOS developer here.)

The OS configuration of Guix is declarative, like that of NixOS:

https://guix.gnu.org/manual/en/html_node/Using-the-Configura...

However, it was designed to be more hackable and easy to inspect, which is facilitated by the fact that it's integrated in a general-purpose language.

As an example, that allows the `guix system` to verify properties before you deploy a system: that the config does not refer to non-existing file systems, that the initrd doesn't lack modules needed to mount the root file system, that there are no references to undefined system services, etc.

Inspectability is best illustrated here:

https://notabug.org/civodul/guix-explorer

Another big difference is that the relation between services in Guix is explicit, as can be seen above. Conversely, a NixOS service can modify anything in the whole system config, which can make it harder for users to understand how the final config came to be.

Side effect (NixOS users will understand): someone writing a Guix service doesn't have to worry about `mkIf` and other contrived constructs, they won't even have to care about fixed points and infinite recursion. :-)

Re: NixOS and the Art of OS Configuration (2018)

#85
post #69
post #50

Earlier quoted context omitted.

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 trans…

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.

Re: NixOS and the Art of OS Configuration (2018)

#86
post #68
post #50

Earlier quoted context omitted.

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 trans…

> I just feel free and am not afraid to fuck up anything Until you have to install the latest NVidia drivers, I suppose.

Luckily not [1].

1: https://nixos.org/manual/nixos/stable/#sec-x11-graphics-card...

Re: NixOS and the Art of OS Configuration (2018)

#87

Earlier quoted context omitted.

> It is simple and fast to install. People make NixOS feels like black magic. NixOS is easier to install than Arch linux. Just do 3 things. Partition your disk, create the nix configuration file and finally run the command "nixos-install" command. Step 2 is doing a lot of work here. It's pretty 'draw the rest of the fucking owl'.

Yes. Using NixOS as a personal desktop for doing development can take a lot of work. You can expect it to take more work than just making the same setup in Arch linux, or whatever. My experience with Nix is that it's 95% wonderful, 5% very painful. -- Navigating the painful parts of Nix requires understanding what's going on with the Linux parts, with the Nix parts, and with the parts of whatever you're trying to do.…

> My experience with Nix is that it's 95% wonderful, 5% very painful.

This is very true. Having used NixOS as my main OS for 5 or 6 years now, the encouraging thing is that the '95%', the 'happy path' is growing all the time. It'll never be 100%, but more and more people will find that Nix's 95% covers 100% of their own use cases. (This is especially true as Flatpak matures and gains popularity, making it more and more useful as an escape hatch for running oddball software that Nixpkgs contributors haven't had a chance to wrangle yet.)

Re: NixOS and the Art of OS Configuration (2018)

#88
post #83

Earlier quoted context omitted.

It's not unique at that though. FreeBSD has had this for a decade. And Ubuntu is adding it now as an installer option. PS: I do like the idea of NixOS and its USPs which are indeed unique :) For me what's stopping me is the learning curve. I don't mind learning per se but if I put the time in it I'd like it to be for something that's useful in more places. Like ansible.

What's interesting about NixOS' seamless NixOS support is that ZFS can't be included in the Linux kernel, and so that kind of integration takes more work with Linux distributions, so relatively few distros have it down pat. BSDs don't face that kind of integration challenge, since they can just ship ZFS support directly in their kernels. They have recently faced an integration challenge of their own, though: rebasing…

Can you elaborate a bit more on why ZFS is great? I am currently thinking about doing "one final install" for my system, and am undecided between BTRFS and ZFS.

I noticed that most "hip" people use ZFS, but based on my meager research it seems actually recommended and designed for "big" data-center setups.

Why is ZFS good for small PC setups?

---

If am being honest I just want something that works reliably, is easy to extend and doesn't require maintenance. Maybe ext4 is good enough?

Re: NixOS and the Art of OS Configuration (2018)

#89

Earlier quoted context omitted.

Unstable (most often than not) is almost an exact copy of the latest branch, which means it has most of it's packages updated to latest version. Given the nature and abstractions of NixOS, unstable ends up being way more stable than most distros, you also get rollbacks for free.

But unstable repo is always a second tier citizen in most distros. This means less eyes on them. This is where Arch excels. Arch just provides packages "as is" or how it was intended by the upstream and the packages are first class citizens. So they get as much as attention as it is gonna get. The usage of "unstable" itself is from an era where even stable versions broke a lot. This is not the case anymore. And stabl…

Among contributors (and maybe even among the whole community), unstable is probably more popular on NixOS than the stable releases, so if anything it has more eyeballs.

The distinction also matters less on NixOS anyway, since you can (generally) freely mix and match packages from different releases.

Lots of Nix packages are totally unmodified, but many also have to be patched in able to cope with the read-only package store.

On the other hand, NixOS is, like Arch, a distro without any defaults aside from systemd. So Nixpkgs doesn't include patches that try to reshape upstream packages for the sake of some particular vision of the ideal desktop experience or whatever.

Re: NixOS and the Art of OS Configuration (2018)

#90
post #35

Earlier quoted context omitted.

Is unstable directly upstream stable version of packages exactly like Arch? Cos that is what I want. Cos in Linux distro context, debian or nixos unstable repo just means it is not yet tested for the specific distro. But in fact the packages itself would be latest stable versions from upstreams. I did read my reading but it is really blurry and hard to find information on how often the packages gets updated. I also w…

Pretty much yes, I also switched from Arch and this works great for me. I only had issues a couple times with broken packages, then you can either not update at all or remove those packages. It should also be possible to keep the older version of those packages in the nix config but I did not look into it.

Yeah, there are a few ways to do this. See the section on 'Pinning an unstable service' for an example of how to pull in just one package or service from another release:

https://nixos.wiki/wiki/FAQ/Pinning_Nixpkgs

Post reply on HN