NixBSD is an attempt to make a reproducible and declarable BSD, based on NixOS. Although theoretically much of this work could be copied to build other BSDs, all work thus far has been focused on building a FreeBSD distribution.
↫ NixBSD GitHub page
Look, it’s my job to make sure I use and am familiar with as many operating systems and related tools as possible. As much as you guys support OSNews on Patreon or Ko-Fi, it’s going to take a lot of you to push me to dive into Nix and NixOS, because every time I hear anything about it, people seem entirely in over their heads and spending way, way too much time trying to properly use it. I have a wife and two little children, and as much as Nix intrigues and fascinates, I’m not going to lose my sanity to it.
Anyway, combining NixOS with FreeBSD seems like a fun project and a great idea, and also kind of an inevitability – any cool technology eventually makes its way to BSD in one way or another, after all. The project is in flux, and they’re not at the stage where you can just download an ISO and get going, but if you’re already knee-deep in Nix and want a new challenge, this might be right up your alley. Me, I’m not learning a programing language just to manage my packages.
Or should I? For the memes?
I have been looking at NixOS for ages. From afar, it looks like a magical unicorn, a distro which would solve all the problems that all sysadmins and software engineers constantly encounters. From a closer look, it looks like a mess. You’re supposed to be able to use only these LISPish scripts which contain all of your configuration, unless of course you use an application which does not support this kind of configuration, which happens constantly. And oh my god, why a LISP derivative for configuration? There are so many languages to choose from, why a one that feels so alien and barely readable and maintainable?
It’s an OS which I would like to love, but it feels too clunky for any real use.
> why a LISP derivative for configuration?
I am _not_ well qualified to answer this, but if the choice seems random, then maybe I can point in the direction of the answer.
I don’t think Nix is Lisp-y. My impression is that it’s a _purely functional_ language, as in, a subset of functional programming languages. There are quite a few of those, such as Haskell or Erlang. Lisp is _not_ one: it’s not pure, meaning that it is possible to use Lisp as a functional programming language, but you can use it in other ways too.
But even so, Lisp is the most famous language that can be considered as one of the functional languages, even impurely. People can and do real-world stuff in Lisp. There are video games in Lisp, and of course a quite well-known editor.
https://en.wikipedia.org/wiki/Functional_programming
FP is interesting because it’s a radically different way to do programming. Considering FP as a way to write code, then all imperative languages are the same language with slightly different syntax. C, BASIC, Java, Cobol, Bash, Fortran, Perl, Ruby: they are all just Algol with tweaks.
FP is _that_ different.
And the thing is that FP eliminates the entire possibility of whole classes of bugs that affect _all_ of those languages.
So, when you use a functional language to declare your system config, and structure packages so that a purely functional language can manipulate them, then you eliminate whole large classes of problems from ever occurring.
Saying that…
Nix and NixOS are very impressive, but they solve problems I just don’t have. I have no personal use for them, much as I have no use for FP.
And they also have terrible punitive costs, which the giant brains who like FP and Nix can’t see: to these folks they are trivial implementation details, like a filesystem layout that totally throws out the Unix hierarchy and replaces it with something that isn’t human-readable. That’s not important to Nix folks, and they can’t see why it’s a deal-breaker for ordinary mortals. We need to get over our obsessions and let go and then we’ll achieve enlightenment.
To which I’m inclined to invite them to get off their high horse and design a v2 which uses a human-readable FS layout first. GoboLinux is a great model here. It doesn’t do all the clever stuff Nix does, but a human can read it and understand it.
Supercomputer packaging tool Spack uses human-readable names, but deployed by software. Adapt Spack to the Gobo hierarchy, make Nix 2 able to manipulate Spack package trees, and one can envision something that brings the advantages of Nix but _also_ replaces the cryptic Unix layout with /bin and /lib and /usr and all that three-letter 1960s rubbish with something _more_ readable.
But the Nix folks can’t see why you’d want that.
Or, an alternative take, as a friend of mine put it: software breaks. All software breaks _sometimes_. When Nix breaks, can he understand and fix the structure it created, entirely by hand? If not, he won’t touch it. And the answer is “no”: he can’t, nobody can, so he won’t touch it.
That makes perfect sense to me.
Much more sense than a Nix evangelist telling me how it solves whole categories of problems I don’t have.
NixOS ist the hammer to whom every problem looks like a nail. 😉
I like the idea of NixOS but it goes to far IMHO.
That would be very easy to fix: Nix devs would just need to symlink /usr to /run/current-system/sw. I personally find it very readable, it’s the software of the current system.
That’s not true, at all. When something breaks in Nix you find what’s the issue, patch your system’s config and rebuild. You now have a system to test the fixes on, with the chance of rolling back by just unpatching the config.
FP languages are very dynamic, and allow one to easily build a custom DSL on top. They also allow for some static analysis easier than imperative without overhead, like tail-call recursion or type inference.
Parodper,
It’s a really cool and powerful idea to have functional languages generating config files. I look at projects like exim and think to myself “scripting is very useful, but what a shame they went with such a bad DIY scripting language rather than going with a real & mature functional language.” Being able to use a scripting language across the entire OS would be quite good. But I just question the use of lisp though. It’s very easy to implement as a simple stack machine but also very notorious for being difficult to read by humans. There are many good functional programming languages. I would have preferred haskell or even forth, which is another trivial language better suited for humans.
This is great news to everyone who think that NixOS isn’t niche enough.