NixOS 22.11 “Raccoon”
NixOS&#x27; infamous learning curve has an undersung sweet spot. I recently discovered a bit of a ‘vlog’ (the video part is just a static image) describing NixOS from the perspective of a self-described, impatient, fickle hacker, which I think testifies to this very well. It begins:<p>&gt; I am not a smart man. The difference between success and failure to me, is <i>razor</i> thin. I am impatient. I am hubristic. I am easily bored. I have it in my to be tenacious, but it has to be <i>drawn out</i> by reward at the end. And NixOS ticks all these boxes for me, in a way that other systems really don&#x27;t.<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=17-TRCpDizA" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=17-TRCpDizA</a><p>I think it&#x27;s worth listening to as it is, but below, I&#x27;ve tried to condense and summarize the parts of that 30-minute video most relevant to that point, for folks to whom the pacing of a relaxed, rambly, personal monologue does not appeal.<p>&gt; I&#x27;ll give you an example. All my systems have the same set of installed programs now. Now that <i>seems</i> real simple. Y&#x27;know, they all say, let&#x27;s say, `screen`, or `tmux, or they all have Ardour, or they all have the same Emacs configuration. I know that sounds basic, but that has never happened to me before [laughs]! I&#x27;m just too easily bored [smiles] to invent such a thing that would make it possible for me to do that. [...] System configuration, instead of being this laundry list of <i>chores</i> to be done, becomes a programming exercise. I&#x27;m comfortable with programming exercises. I do not like chores.<p>&gt; [...]<p>&gt; The integration between Nix the language, Nix the package manager, and NixOS the operating system means that I&#x27;m not required to invent very much. [...] Everything I just described to you, I could have done 15 years ago, with systems like Puppet [or] Ansible[.] [...] However, while using those systems, I am required to make choices about how things are done. And those choices really have some stop[ping] energy to them. Some of the choices are so low-level that they&#x27;re uninteresting, and it becomes rather boring rather quickly to do [something like] Puppet or Ansible. ‘Where is this `authorized_keys` file supposed to go?’ I don&#x27;t really care! [laughs] I just want [...] to be able to log into that system.<p>&gt; On top of all that, where [with NixOS, it feels like] I&#x27;m just motoring along [unimpeded]— I&#x27;m creating a configuration very quickly that <i>rewards</i> [rather than drains] me— at the end of it, I can <i>share</i> that configuration with someone else in a meaningful, even executable, way. And the way to execute it is well-understood. There&#x27;s no trickery [hidden in the deployment environment]. This is also [supposedly] the same with Puppet and Ansible, but somehow, no one seems to <i>do</i> it! You don&#x27;t see people <i>sharing</i> Ansible configurations. This culture of sharing configuration, of sharing declarative statements about builds, is something that is [...] in quantity and quality, unique to NixOS.<p>&gt; I recently heard from a friend [...] who somehow saw my videos [on NixOS]. [...] We never spoke about NixOS before I heard from him [about this]. But he took the configuration that I&#x27;d put up on GitHub, [...] made a couple of changes to it, and he got one system up and running. And he said ‘Wow, that was easy!’. This guy has been doing [Unix and Linux systems administration] for <i>25 years</i>, and I can&#x27;t imagine that he&#x27;s ever done such a thing before. [I can&#x27;t imagine that he has ever] just walked up to some repository, and [simultaneously] had [...] the inclination, the confidence, and the ability to repeat a build [of it] on his own system. [...] He actually said to me at some point, ‘What have you done to me?’ [laughs]. Of course, I didn&#x27;t do anything. He&#x27;s well on his way to converting all of his other systems to NixOS.<p>&gt; [...]<p>&gt; I think [Nix&#x27;s features] sort of feed into each other, as a [...] virtuous cycle. Like I said: I am not a smart man, I am not a patient man. I <i>can</i> be tenacious, but it really takes me feeling like I&#x27;m gonna get something at the end. [...] [W]ith Nix, I don&#x27;t feel like I&#x27;m wasting my time, I find myself— surprisingly!— getting to the bottom of issues that I <i>could</i> have gotten to the bottom of on Ubuntu, or Manjaro, or Fedora, or whatever else I was using, [but never did]. I could have fixed them there, but man, the reward for doing so was just <i>minimal</i>.<p>&gt; [...]<p>&gt; [That&#x27;s because] first of all, if you&#x27;re <i>not</i> running a configuration management system, and you have to do it manually on every system... that is <i>really boring</i> to have to do. So the answer is to run a configuration management system. But the configuration management tools that are available for these systems are [...] just <i>me typing</i>, except automated. [...] There are sort of [declarations], but they definitely have an order. And you have to <i>know</i> the order, you have to <i>control</i> the order. In the NixOS stuff, <i>I&#x27;m not concerned about order</i>. [...] Nix uses `bash`, under the hood, so of course I&#x27;m [actually] running bash­— yeah, sure. But I&#x27;m not [thinking about it] very often.<p>&gt; People have anticipated the kinds of things I wanna do in [the] Nix [world;] I just reuse whatever they did. It is [admittedly] a game of inches here. I often found myself in a place, with my other systems, where all of them were configured completely differently. I just didn&#x27;t bother with configuration management stuff. It&#x27;s not like I haven&#x27;t used configuration management tools. I use them all the time. [I use them] at work and stuff, but for my own systems, it just seemed like ‘ugh’. It was like going to work! [...] ‘Ok, now I&#x27;m back at work, and I have to name these steps.’ It&#x27;s dull. It&#x27;s boring.<p>&gt; [But] now that I have Nix[OS], I&#x27;m getting to the bottoms of these stupid issues, like [...] fixing my computer&#x27;s sleep. Even though I would have had to do exactly the same thing on Ubuntu or Manjaro or Fedora, or any of that stuff— it&#x27;s the same system— but I actually <i>do it</i> now. Because I&#x27;m like ‘Okay, fine. I can write this down <i>once</i> [and for all].’ NixOS has nudged me over the edge of feeling like I&#x27;m not wasting my time [...] and that makes me tend to get to the bottoms of issues. Success [now] more often seems possible than impossible. Before, it just seemed impossible, like<p>&gt; &gt; I am <i>never</i> gonna get this under control. I am just gonna live with chaos.<p>&gt; [laughs] Everyone has chaos. But in this game of inches, NixOS has just pushed me over the edge that little bit, to where I have things working that I&#x27;ve never had working before. Some concrete examples:<p>&gt; - I can bring up a new system with the vast majority of configuration that I actually use in 20 minutes. [...] (20 minutes would be a long time, actually. I would have to make a couple mistakes.)<p>&gt; - [Due to random differences in sleep behavior, mDNS configuration, and God knows what, before] it was always a crapshoot when I&#x27;d type `ssh some-host-name` whether I&#x27;d actually get in. [...] Now that all of these systems share the same configuration, that hasn&#x27;t happened to me.<p>&gt; - I can print from any system. I know it sound stupid. But yes! I don&#x27;t print often, but when I wanna print, I just wanna print. That was <i>never</i> possible in my old configurations. I&#x27;d always have to [fuck] around with printing.<p>&gt; - I can shut the lid on any of my laptops that are connected to external monitors... and the won&#x27;t go to sleep. I know, I know— it seems stupid, but it&#x27;s true! I figured it out. [Thanks to NixOS], I put enough time into that to fix it.<p>&gt; - I can shut the lid on laptops <i>not</i> connected to external monitors, and they <i>do</i> go to sleep. They go to sleep! They don&#x27;t just sit there [...] [shining] the monitor light on the keyboard for two hours, running down my battery. [...] It&#x27;s because I was <i>rewarded</i> [along the way] when I put the time in.<p>&gt; - I can carry around [...] an external ZFS-formatted drive, and I can plug it into any of these systems and mount it. It can even be encrypted!<p>&gt; - Once I log in, I can send and receive Keybase messages on any of these [5] systems.<p>&gt; - I can use my stupid Roland looper on any of these systems. [NixOS encouraged me to] put the time in to add the kernel patch that it requires.<p>&gt; - I can use an old build of a package— built <i>years</i> ago— to solve dependency bitrot. The current version of a package I use <i>will not build</i>. But I can transport myself back in time, just for that one.<p>&gt; Another thing I noticed while I was asking questions in various support channels for NixOS is that it somehow also happens to have a <i>really excellent</i> community. I haven&#x27;t seen this kind of community in many other places. I saw it (way back in the day) with Python. And before then, [laughs] I think the only other place I&#x27;ve seen it was on bulletin board systems. There&#x27;s unreal politeness, and humility, and thoughtfulness, and thoroughness on <i>all</i> of the support channels I can think of— Discourse, Matrix, IRC, GitHub. [...] There&#x27;s no ‘RTFM’, there&#x27;s nobody flexing there. [...] It is the default [on the Internet] to see people flexing and being assholes in support [...] but there&#x27;s <i>none</i> of that in the NixOS community. [...] It is astounding to me. How did it happen? [In the NixOS community], everybody is smarter than I am. <i>Everyone</i>. I love that!<p>&gt; [...]<p>&gt; Once you give [NixOS] a fair shake, you will not go back to something else. [...] The idea that you would look at NixOS, use it for a month, and then be like ‘eh, idk, I&#x27;ll go back to Fedora’... I don&#x27;t see that happening to many people. My mind would be blown by that happening.