Tech Over Tea - Giving NixOS Linux A Proper Try | Shahar & Farid

Episode Date: June 6, 2025

I did a NixOS focused podcast a few weeks back and it was a good episode but at the same time I feel like we got too caught up in the weeds of Nix terminology, so lets do a part 2.==========Support Th...e Channel==========► Patreon: https://www.patreon.com/brodierobertson► Paypal: https://www.paypal.me/BrodieRobertsonVideo► Amazon USA: https://amzn.to/3d5gykF► Other Methods: https://cointr.ee/brodierobertson==========Guest Links==========Today we have the founder of All Things Linux, Kaizen on the show and you might think this is just some Discord community but there's a lot of ideas floating around for how to expand into much more than just that==========Support The Channel==========► Patreon: https://www.patreon.com/brodierobertson► Paypal: https://www.paypal.me/BrodieRobertsonVideo► Amazon USA: https://amzn.to/3d5gykF► Other Methods: https://cointr.ee/brodierobertson==========Guest Links==========NixOS Website: https://nixos.org/Farid Blog: https://fzakaria.com/2024/07/05/learn-nix-the-fun-wayFulltime Nix: https://fulltimenix.com/==========Support The Show==========► Patreon: https://www.patreon.com/brodierobertson► Paypal: https://www.paypal.me/BrodieRobertsonVideo► Amazon USA: https://amzn.to/3d5gykF► Other Methods: https://cointr.ee/brodierobertson=========Video Platforms==========🎥 YouTube: https://www.youtube.com/channel/UCBq5p-xOla8xhnrbhu8AIAg=========Audio Release=========🎵 RSS: https://anchor.fm/s/149fd51c/podcast/rss🎵 Apple Podcast:https://podcasts.apple.com/us/podcast/tech-over-tea/id1501727953🎵 Spotify: https://open.spotify.com/show/3IfFpfzlLo7OPsEnl4gbdM🎵 Google Podcast: https://www.google.com/podcasts?feed=aHR0cHM6Ly9hbmNob3IuZm0vcy8xNDlmZDUxYy9wb2RjYXN0L3Jzcw==🎵 Anchor: https://anchor.fm/tech-over-tea==========Social Media==========🎤 Discord:https://discord.gg/PkMRVn9🐦 Twitter: https://twitter.com/TechOverTeaShow📷 Instagram: https://www.instagram.com/techovertea/🌐 Mastodon:https://mastodon.social/web/accounts/1093345==========Credits==========🎨 Channel Art:All my art has was created by Supercozmanhttps://twitter.com/Supercozmanhttps://www.instagram.com/supercozman_draws/DISCLOSURE: Wherever possible I use referral links, which means if you click one of the links in this video or description and make a purchase we may receive a small commission or other compensation.

Transcript
Discussion (0)
Starting point is 00:00:00 Good morning, good day, and good evening. I'm Azul, your host Brody Robertson. And a few weeks back, I did a NixOS episode with Tristan Ross, who was a release manager on a recent release of Nix. And I feel like that was a good episode. Don't get me wrong. But at the same time, a lot of people did say we got bogged down in terminology and things could have been explained in a better way. So I guess how about you both introduce yourself and talk about why we're doing what your background is with Nix and why I would even be talking to you about the project.
Starting point is 00:00:44 like background is with Nix and why why are we even be talking to you about the project first i want to say Tristan is a uh is brilliant uh and he's a he's a valuable contributor to the Nix ecosystem absolutely i think he recently announced that he joins the Nix he joins the Nix hardware team. That's really nice. Awesome. Yeah, no, don't get me wrong. I think it was a good episode. I think Tristan does amazing work. It's just, we did very much just focus on sort of the terminology rather than the functionality. I think that's a good way to put it. Classic Nix pitfall. Right, right, right. You're trying to enlighten someone and then you board them to death and
Starting point is 00:01:29 scared them away. Can both of you introduce yourself? What are you? What are you to go first? Let me start. Oh, OK. Yeah. My name's Fareed. My voice is a bit hoarse.
Starting point is 00:01:44 Sorry. We'll try to make it go well over this chat. I'm an engineer by trade. I've been using Nix non professionally for 10 years. Sort of pseudo professionally for several, you know, maybe five years, I got to introduce it at some teams at Google, and now I'm at Confluent. And I just finished a PhD where Nxt helped me do a lot of the reproducible software that you need to do when you submit and it's Nxt adjacent. So yeah. Okay. How about you go? My name is Shachar Oh, you can call me Don, it's easier. I, for the last few years, I centered my work around Nix and the ecosystem. I've been doing a Nix podcast. So far I think it's the only NX podcast for over a year. It's called
Starting point is 00:02:46 Full Time NYX. You can find it on your favorite podcast app. I saw that video you made with Tristan and it was interesting and I probably learned something I don't remember by now. But yes, Tristan is a deep thinker and he'll give you all the technical answers. But for the general, should I use a NixOS Linux? I think we need to answer some very general questions first. Oh yeah, sorry, go ahead. I was inspired to contact you Brody and I invited Fareed as well to join us.
Starting point is 00:03:40 Well, I appreciate that. But when we get into like the main thing of Nx and all that, why did you decide to do a Nyx podcast? That's a very, like very niche topic to do a podcast on. And that's a good reason, right? Get a niche, get a niche and try to provide value to your listeners. And as I said, there is there wasn't one at the time. And I try to try to grow. And maybe it'll contribute to my reputation, maybe that will allow me to make a living off of doing nextix-related things.
Starting point is 00:04:25 I want to do open source development primarily, and I'd love to get sponsored to do that. And I know some people who, one way or another are getting sponsored to work on open source in the Nix ecosystem. And I have enjoyed some of that as well. And I'd like that to continue to grow. Fair enough.
Starting point is 00:04:49 For myself and for others. So did you guys, I didn't listen to the whole episode. Did you guys get into the drama at all with Tristan? The, I don't really know much about it myself. I've got like a very surface level look at it. I don't really know much about it myself. I've got like a very surface level look at it So I didn't really know where to even start with that if you want to talk about that Okay, okay fair enough fair enough
Starting point is 00:05:22 Yeah, I people send me links every so often and every time I decide I want to go look into it I realize there's about Four hours of reading I need to do to get like caught up on everything that's been going on and then I decide not to do it, so I'm not too sure on the details there. Yeah, I just it's like, you know, frustrating thing, but I actually think it's a good sign. That sounds. Nihilistic, but like it's just a sign of a growing community going through, you know, and I saw it in Python and software foundation and other popular Linux distros. So it's just like a classic growing pain. Right, right, right.
Starting point is 00:05:57 As the stakes grow higher, as users use it more and they use it for more important things, well then they care more and then the drama intensifies. Right, right, right. Anyways, yeah, sorry. No, no, it's all good, it's all good. If you want to derail, go any direction, feel free to bring up a topic. If I have, I've said this to plenty of other people, the less that I have to talk, the better I think the episode is going. Yeah, yeah. I got, well, I got, you know, yeah, we have plenty of things. Nyx is like, the better I think the episode is going. Yeah, yeah. I got, well, I got, you know, yeah, we have plenty of things. Nix is like, the beauty of Nix is it does everything.
Starting point is 00:06:32 So you could also talk about, it's like the bottom floor. It's a philosophy building software. So it's like what, you know, I was just listening today about like, you know, I'm in the States and we're doing trade wars. So unfortunately, and we're doing trade wars. So unfortunately, and they're doing tariffs. And this podcast I was listening to is trying to talk about how to decide the country of origin for tariffs.
Starting point is 00:06:58 So in the US, they do this whole like essence test. What is the essence of the software? And at some level, like that's what NYX is like essence. It's like how to be and you see this because there's like derivatives So like we're talking about next I like to use the word in my PhD. I call them store systems Things that put things into a store is like older like not your normal folders like, you know, Nick's it's called the next store And geeks it's geek store. I work with people in SPAC is another very popular one, high performance computing. They have their own store. It's this like thing on how to totally build software. And then all these other things kind of matriculate and fall
Starting point is 00:07:37 out of it. So it's, I don't know, you can get like really philosophical. Before we get really philosophical, I think we should answer the very simple question just for anyone who might have clicked this and has no idea what's going on. What is NixOS? Just at that initial question, and I'm sure that can take us in a lot of directions, but at a high level, what is this distro? And then also what is the next package manager because this can be used separately from the distro itself I think I would go for for like describing What is the typical nick Linux distro? How does that work? my first Linux distro experience was
Starting point is 00:08:23 when I was about 16 and that was what it was a 2003 something and And it's been until today until now it's greatly improved in all sorts of ways, but the premise is that I improved in all sorts of ways. But the premise is that I have an install, I boot something, a live track, then I booted a live CD. Now we don't do that anymore. And then you install it. And then we start making modifications. We install some other service, some other desktop environment, go into our settings and configure it. I remember that recent PewDiePie video that I'm so happy about that we get so much exposure and so many people will learn about Linux that there is an alternative and that it's finally not so hard and not so far-fetched to use it. And I'm
Starting point is 00:09:33 happy that it's so easy. But the problem is that it's not very maintainable. We make these modifications to our systems, but the way I like to say it, we don't get to keep them. We just get to make them. And so then there are solutions to these problems. Get a collection of my dot files in my home directory and put it in a Git repository. Use some sort of backup scheme. And those solutions, they typically work to some degree. But it's not optimal.
Starting point is 00:10:28 It's not optimal. And that's where all this talk about build systems, that's where this is a game changer. NixOS is built. It's a product of a build system, the entire thing. From the top level, my OS, to the dot files in my home directory, it is one big tree of dependencies. That there's a lot of practical value that we can talk about that is a product of that, that approach. It's a big tree of dependencies. This was something we did touch on with Tristan where in Nick in Nick's OS everything is managed under the Nick system as opposed to
Starting point is 00:11:32 What you would have with a regular distro where things are sort of spread out across Everywhere in your system like on arch if I wanted to go change some little system configuration file There'll be a tool to do it. There's a file somewhere But it's probably gonna be consistent across distros But the way that you interact with it isn't gonna be consistent and trying to replicate a system onto another one With something like arch or something like a boon to there are ways to do it But it's not something built into
Starting point is 00:12:05 the core structure of what the distro is. Right. The workflow. Right. There's one more and it's like, what's tough is like, which way do you want to tackle Nixos? And this is like the conundrum. Like outside in or inside out. You know, outside in I think you sometimes fail to see the Marvel and then inside out like starting with Nix it's like you get bogged down in the details.
Starting point is 00:12:34 But there's like one important distinction with NixOS is all these other distros, those collections of common folders, you know, Etsy, lib, bin, user bin, it's called the FHS, the file system hierarchy standard. So that's like some standard that most distros follow. And the central problem that Nix is trying to solve is folders have a small key space. What do I mean by key space is like, you can only have one name under a folder. I want library gung ho. I can only have like lib gung ho once. Maybe I could put like version one, two, three,
Starting point is 00:13:15 but let's say I want like version one at this commit. You know, it has to have that name. Like there's a lot of underlying things that require that. And we can dive deeper into that but like Nix solves that. And NixOS lets you take a collection of packages and construct a distribution with, you know, and then like goes even further and lets you do that with nix the language so it gets like even more insane But like a distribution the thesis which is pretty readable at least the first half That wasn't an insult to Ilco. Sorry. I just like the first half is much more readable
Starting point is 00:13:59 Oxibots how to build software and then he just layers and he says like well once you know how to deliver a file Once I could build a file, Linux is beauty, Unix is saying everything's a file. And then a distribution is just a collection of files. So if I can just create a package, which is a package of packages, well, that's a distribution. So if you can build one package in next, you can build a package of packages. And a distribution is just a package of packages. I mean, everything about how Linux works is files, you want to run system D, but these system D configuration files and Etsy you want to do something else, put this file here and Etsy. So it's all it's just like files on disk at very specific places and you're done. So I don't know. Yeah.
Starting point is 00:14:54 No, sorry. Yeah, I was gonna say NixOS at its core, I think is a collection of files. And then maybe Don can go into more. It's like, I think is a collection of files. And then maybe Don can go into more. It's like, I think then it goes really. I think where people have the problem with it is that it needs this new language because you also configure it. You don't have to. I think that's just like the current status quo.
Starting point is 00:15:20 You have to use the next language and it is likely off putting to many people because it's functional and that's, you know, very different than a typical imperative way of thinking, especially when you think of like more advanced functional concepts like infinite recursions and stuff like that. So for anyone who might not have as much of a programming background, can you just explain the difference between imperative and a functional approach? I'd say there's three. I want to draw a distinction as imperative.
Starting point is 00:15:56 And then there's declarative, which is like, and then there's, I think imperative programming can be also functional and non-functional. There's like a couple of like different joint sets. So imperative programming is like when you do a line by line and it's like how you might think of running through a list of tasks and they're temporal. So like a task earlier on has to be done before the task after it. And you're just running through a sequence.
Starting point is 00:16:26 Declarative programming. If someone has ever heard of SQL, that's like writing a list of tasks, not even a task, you're writing what you want done and you're leaving it up to the thing, the computer, the person, whatever, to go execute your plan. So you might say instead of like how to make a burrito, all the different steps, you just say like, give me a burrito and it's up to them to figure out all the beauty. You know, and the beautiful thing is you just articulate what you want and you store it. You say, I just want a burrito.
Starting point is 00:16:59 And you really don't care about all the other actual steps in the order. Maybe they want to put rice for us or beans. It doesn't matter. So that's declarative people love declarative because you get to the root of what the problem is, and you don't get bogged down in the steps and you and then you can optimize you like decouple the ask of the request and the steps to do it and then someone who's like an expert in planning or whatever can go off and, and do that. functional programming is a different way of doing, I'd say imperative programming. And the key distinction is you try not to
Starting point is 00:17:38 use state. Every line is almost, they like to use the word pure, pure meaning it relies on no states. You can shuffle these lines in any order and still get the same outcome. That's functional programming at its core. I don't know. These are hard concepts to kind of... Yeah, yeah. And some computer science laureate is probably like yelling at a cloud as he hears me.
Starting point is 00:18:08 Oh, I know. I have at least a couple of Haskell fans in my viewership. So I'm sure they will go very hard on what are the benefits of functional programming and why everyone should love it. I think the main issue with functional programming is imperative is... it's a very... how to say... steps in the real world are very transferable to an imperative process. Like you even if you don't have a programming background, you can walk through what is happening
Starting point is 00:18:49 in a Python code base, for example, and understand each step that is going on and logically break down that problem in a way that, like if you're like, how do I build a chair, right? You think about that in an imperative way. You grab the nail, you grab the wood, you hammer the nail into wood. Like, this makes sense. Functional, you really have to think of it in a... I don't know the best way to describe this. This is the problem. Anytime you start talking to a funking program, it's like, how do I describe how this works? I think-
Starting point is 00:19:31 Can I show you some? Can I share my screen? Show some mixed code? Go right ahead, yeah. By the way, do you know what the most popular programming language in the world is? I would have guessed something like a JavaScript, but you're going to say something different? I think it's Excel, Microsoft Excel. And that's a functional programming language.
Starting point is 00:20:19 Here's where I store all my... I have three... two desktops, one laptop here and I'm going to do to go into some file here and for example this one there are no functions here this is a this is all a from the top to the bottom. It's declarative. It says Flake modules, NixOS PC. So I have a NixOS module that is called PC. And in it, I'm declaring that I, for example, this one under boot, kernel params, I want this kernel param, that kernel param. And I want to enable Plymouth. So they have a nicer, quiet graphical boot. Of course, there are functions as well.
Starting point is 00:21:37 Here is a more, let's say, this is a function when you see a colon, it's a function. And here is how you make bindings. And this is the body of the function from here all the way down. And here is a type operator. And this is the power of Nix and NixOS and also the efficiency of it because you gotta put in the effort, put in the time to figure it out. And I wish, I put in the effort so I feel like I have superpowers that the Arch Linux user doesn't have. But I've put in so much effort.
Starting point is 00:22:33 And there is no book that you could pick up. But, um, NixOS for newbies, NixOS for Linux users, something like that. I wish there was. And I invite everyone who has the time, who have the time to look into it, to put in the effort because once you know it, it gives you, I guess it's super powers, a lot of value in it. I'm gonna give a contrasting one to that. I think people, someone at the last NYX conference
Starting point is 00:23:16 called Planet NYX in North America demo they were using NYX OS to power their schools. He was like from Oregon, I wish I could remember his name. They bought a bunch of Chromebooks. He got a bunch of donated Chromebooks and ran NixOS on them and just put the Flatpak app server on it and gave it back to the school.
Starting point is 00:23:40 They don't know they're running NixOS. They're just running Flatpak. But he's able to configure the other stuff that you might want Like a reboot cycle like oh, you know, he's a system administrator for that school. He did all the setup they don't know they're running next OS I consider that a huge win they're getting a lot of the power and Efficacy of Nick's OS, but you know, they might not need to like write NixOS configurations in the same way like look at all the people that use Linux. I mean, clearly
Starting point is 00:24:16 a lot of them just want something that mimics a really turnkey distribution like Ubuntu or whatever and they don't want to do Linux from scratch or Arch or Gentoo. So I used to be really hard on pushing people to Nix and I've gotten a little more like I have this central one sentence like part part of NYX the problem is like software works pretty good already like you use NYX and you think holy shit nothing should be working like you really come away with that you're like how is anything working like but you know we're on this video camera things are working and it's because like a bunch of other people are spending so much time fixing their software. Like the
Starting point is 00:25:09 care and effort Don put into his district, his own personal app, people are putting into all their software. So it works in all these bespoke cases. And like, that's cool, but it also devalues, like Nick's is saying, like, you don't have to do that. And we'll make it work. Just, you know, without cool, but it also devalues like Nick's is saying like you don't have to do that and will make it work Just you know without that, but everyone's still doing all that work So yeah, I don't know you support. I still love it. I mean we could talk about how much joy I think you can hear from his voice when he talks about it like people that love control And like knowing what's going on and that's why I run NixOS like brings me immense joy.
Starting point is 00:25:48 But a lot of people like, should I use it? I'm like, no, there's some other Nix stuff. I steered them towards first to get them hooked. Um, yeah, cause, cause I've been bitten, like I have them use NixOS. Never will they hit a paper cut its software. It has a bug and you know, and for me to attract them, the first thing I did was like, I told them like this is perfect software. Like this is going to solve all your problems. Right, right.
Starting point is 00:26:16 And you said the expectations way too high then. Way too high. And the reality is also the deltas like not that far because Most software I have more trouble running some software now on Nix OS Than I do on a normal Linux distribution like that's messed up. That's weird Hey, because like Nix OS should be I mean once I get it to run on Nix OS I've told myself like it'll run forever perfectly and like that's the goal. But as a new user, if you're being inspired to use NixOS because it's like things are going to work,
Starting point is 00:26:56 it's like that's the sales pitch, like software that works, it's reproducible, reliable. And you come on, you open NeoVim or VS code and it just start Lee starts like flashing error messages as it's doing things that don't work You're like what that is going on? mmm Especially without the understanding of like it's trying to rebuild things from the ground up That said I think like people that usually use Linux love control. Like if you're already starting off as a Linux user, I think you skew more in the like, I like what's going on with my machine.
Starting point is 00:27:39 That's the beauty of Linux that I don't like. I have to use a MacBook for work. Like the beauty that you can just grab the root And find some knob is like amazing And then twiddle it So I Think like it, you know, it's okay. I'll still push people definitely like their windows or Mac. I don't know. They're lost already So, I don't know like that's something we can keep talking about, Don, but that's like, uh,
Starting point is 00:28:09 I don't know, that's too spicy. Like, I'm going to chat about Pro Nix and I'm kind of like, yeah. No, I think about I do think it is good to be honest about the state the things actually are in, because I will often see people talk about Nix as if, you know, I'll get these comments like, Nix solves that, Nix solves this. You get these comments from time to time.
Starting point is 00:28:35 And yeah, I'm sure Nix does solve a lot of problems, but I don't really hear people talk about what can go wrong with it. Besides the fact that the functional programming is, you know, it's functional programming. You get what you get with functional programming. The introduction is kinda... I don't think I know anyone who uses Nix who would disagree that the introduction to Nix is not as good as it could be. And there could be better resources out there
Starting point is 00:29:08 to onboard people into making use of these tools but I don't really hear people talk about those issues that come with actually using it and things that might go wrong because of the file structure because things aren't maybe set up correctly to work inside of Nix and things like that. structure because things aren't maybe set up correctly to work inside of Nix and things like that. Yes, it's yeah for example that VS code example I think one of the issues I've encountered when I I don't use VS code these days, but when I did Home Manager, I used to install a VS Code via Home Manager and to configure it via Home Manager. It's a lot of value because I can declare all the settings
Starting point is 00:29:53 and all the extensions I want via Home Manager. It's all tracked in my Git repo. Then what I cannot do is ask VS code via itself to go in and change some configuration. Because it cannot, because the configuration file is a read-only file in the next store. Right. And sometimes this code wants to do that and it kind of, you know, sorts of like, it asks you a question. I don't remember exactly.
Starting point is 00:30:29 It asks you a question and you say yes or no. And then it says, okay, I will remember what you said, but what is remembering? It's like setting some config option. And then it gives you an error, cannot write to my config option. So there's a mismatch between how next wants to
Starting point is 00:30:48 use programs and How programs expect to be used one times right with simpler utilities? You know, maybe they don't write to their own configuration file met many programs don't write to their own configuration files But many programs do. So it's kind of an inversion of control. And that's exactly what we mean by Nix solves that. Git, for example, another program
Starting point is 00:31:23 that can write to its own. When you do git config with the global flag, it can write to the users git configuration file. But Nix solves that. It solves that in a greater level. I want everything to be done via Nix. So I give up that feature of the app trying to configure itself. So you have to do an extra step.
Starting point is 00:31:49 I don't even know how it works. Maybe you have to tell VS Code, hey, don't bother trying to do this thing again. That's a paper cut. Yeah, software just needs to be so curated to work. It needs to be developed in the XOS in mind, or it's like a lot of labor and love. It's like the ultimate yak shape to get things to work. The amount of software that wants to self-update, for instance, that's a classic one. It needs to be patched away.
Starting point is 00:32:19 Well, we're on Discord right now. Discord. You think Discord from the browser. Fair enough. That's my answer on NixOS for a lot of things is to... Well, and Linux, like, because the Linux installable versions of things tend to suck. But, yeah, like if there's a really great maintainer, that software is gonna be great. But for a lot of things, it's like, someone just wanted some working version of it.
Starting point is 00:32:47 Nick's packages is great, it's very easy to get started. They throw it in there, but it's got a lot of these paper cuts. Right. And like, I don't know, your software is like, the paper cuts matter. Like that's, that sheer amount of them. You know, like I don't know what the audit is.
Starting point is 00:33:09 They do a big community survey. Nix has a lot of people you could use it like as a home manager, sorry, as a home brew. If you're from Mac, get, it's got a big install base. People use NixOS on the server. I think probably the next largest, because you care less about these paper cuts. It's like, it's there, it's in the cloud,
Starting point is 00:33:29 it's running, I don't care. NixOS people running on your laptops, which I do, or your personal desktop. Like when I went to NixCon, like, you know, way smaller, because you have to be a masochist to want to deal with these paper cuts and like it's joy actually like I like I think that's what you find right now that's kind of the niche of the community is like you you want to
Starting point is 00:33:54 like yak shave all the way through and if you guys don't know what yak shave is it's a saying where like one task leads to another and you're like endlessly you went to start to do something and and you're like endlessly, you went to start to do something and now you're like doing something, you're shaving a yak as the saying goes. So, you know, like I'll just fire up my laptop sometimes and it just, I'm like, I like hacking. I'm like, I'll open it up, something breaks
Starting point is 00:34:21 and I'll just pull on that thread and go fix it. Like that's probably not for most people. Yeah, it's attractive. How about I put things into perspective a little bit from my own repository. Have this screen successfully. There's this program called, it's called Tokay. Tokay. And I run it in my info repo and it'll tell me I have 221 Nix files here with 3740 lines. That's for To desktop one laptop
Starting point is 00:35:09 That's but there's much of this is actually a Now I see that the lock the lock file. This is the lock file so nix and all this is nix that I I wrote and If we look at the git How do you see how many Git commits I had in a report? I think quickly I can do that on GitHub. G-A-H-P-O-U-
Starting point is 00:35:34 Git log and then grep commit, I guess. That would be an easy way to do it. I don't know the command for git. It's more than a thousand commits. Mm-hmm. Since I first started. I don't even remember, this repository might have actually started not as a Nix repository, it might have been my dot files, right, right, or use Nix.
Starting point is 00:36:00 But there's these very frequent changes. But there's these very frequent changes. Another piece of perspective is we talked about Nick's packages, right? How many packages there are and the quality of the packages in there. They have paper cuts, they don't have paper cuts. There's this website called Ropology and in it there's this page with graphs. I'll go to the second graph here, not the first one first. This is the number of packages in the repository, and this is the number of fresh packages. Fresh means that the version of the package
Starting point is 00:36:45 in the repository is the same as the latest release of that software. And that's typically what the PC Linux user wants. They want the latest release. So here we can see, for example, the Fedora curve, various versions of Fedora, what packages they have. Here's Ubuntu, it's quite clearly a leader of a number of packages and also how fresh they are. And all sorts of other distros. His homebrew over here, very impressive,
Starting point is 00:37:19 is Opensuse around here. And most distros are, they don't have a great number of packages and they're not very fresh. Right. Where's Arch, I wonder? Oh. Here, here's an Arch one. Oh, yeah. Here's an Arch one, 3032.
Starting point is 00:37:44 This is the AUR. Here's an Arch one. Oh, yeah. Here's an Arch one, 3032. Usually the AUR is the high up there. Arch, that's the Arch user repository? Yeah, it's like, I'm not sure I'm seeing it. Anyway, the second, this is a zoomed in, sorry, this is zoomed in onto main cluster of repositories. That's what this graph is. Why?
Starting point is 00:38:12 Because if we scroll to the first graph, the real graph, complete graph, we see that Nix packages puts them all to shame. Mm-hmm. Sorry for the... That's pretty much what it does. In the number of packages, even the Nix packages stable 2111, I don't even know how that works, how does Nix packages
Starting point is 00:38:38 stable 2111 have greater number of fresh packages well, it's a number of fresh packages. Well, it's a number of fresh packages. That kind of makes sense. It doesn't mean that the set of packages that the PC Linux user would care about
Starting point is 00:38:54 are fresher than Ubuntu or Arch. Right, oh no, ultimately Arch, there's a lot of packages which probably should be in the main repos which are relegated to the AUR like random drivers the little things and stuff like that yeah yeah that exactly my point I don't know if I've never like I know this graph well well in the sense I've seen it a lot not well and I've always wondered if they filter out the package set. Like, Nick's packages is amiss for having a lot of like unnecessary, what I mean by unnecessary is it has every Python
Starting point is 00:39:33 pack or like it has most of the PyPI. It has almost every node package. It has every Haskell package. True, Debbie and all these other ones also have Python packages to some extent. So that that part might have some analog like similarities, but they've done it for every language to a large part that could be contributing to maybe the sheer number of size. It's also missing a third dimension, which is like correctness. I think I just want to bring like that fairness angle to it. Like we were just talking about paper cuts and you can have like 2 million packages, whatever that means that are fresh.
Starting point is 00:40:17 But if they're all begging to be updated, you know, hyperbolically and on NixOS and they don't work well, it's not really meaningful. I don't know how you really track that across that. No, it's too much details, right? Like, it's even... how would I be able to tell that NixOS is a nicer experience than Arch. I'm very particular. I have my Sway window manager currently. I want to switch to Hyperland. I have a very specific set of programs that I use. I have my own notification thing. But even a gnome user I set up gnome for for my wife in on her computer using mixels how do I know that that gnome experience is nicer than the these
Starting point is 00:41:17 things take research what I do know is that I enjoy great benefits. We can talk about them, we can showcase them, I can demonstrate them. I think a... It's not a fully objective way to verify it, but I think a good rule of thumb on the quality of the packages is Your experience using NYX because you're both fairly active, you know in like with NYX How often do you run into things where there are paper cuts where you have to go and fix something like Is this a common occurrence? Is it once every couple of weeks, multiple times a day? Like, what are we dealing with here?
Starting point is 00:42:14 Well, here's my, from my Git history. Did I share here? this. Did I share here? Mm hmm. Uh, I set up auto login. I bumped in bumped inputs. Um, this lunch sway using key binding. No, but I don't. You should answer like this is you have you should have looking right off the I'm looking for some, you know, some problem that I've solved. And I know that I've, maybe if I search for workaround, here's a workaround for some Nix issue.
Starting point is 00:43:00 Or I don't even know, this is Nix itself. If I search for github here Or like issues, I will find some github some comments. There are links No, Stellarium had a bug so I commented it out for now. Here's um wanted it out for now. Here's a bug in Qt browser. I think it's an upstream bug, not a not a packaging bug. I think it's a bug in Qt. I think it's all.
Starting point is 00:43:37 Sometimes there are things. It's also your propensity to, like I hit them pretty frequently, but I just, I don't change them. I'm like, that's what, like my VS code. One thing before you go over that, if you're, if there's nothing we need to show on the stream, can you close that? So it doesn't.
Starting point is 00:43:54 Yeah. Thank you. Awesome. It just breaks my overlay if it's there. I just, I get used to the thing and it's like your, your capability to be okay with like some imperfections is probably kind of like my VS code does this. One of them that bugs me a lot and I don't know how to solve it. I'll like, it'll just randomly scroll away. Like I'll tap back to a file and just Scroll I only get it on my next OS VS code. I don't know why it's doing that
Starting point is 00:44:31 You know when stuff like that happens. I either like I'm okay with it or I switched to a different tool that's happened a little bit It's like this one weird thing is giving me this weird air You know like so it's not always like it needs a fix on my part It could have just been like I'm dealing with it or I've abandoned it. And then I don't change the active changing. I think we like to talk about like, you get to a point where you've curated your machine. Like, there is probably some other graph of how much changes your repo sees over time
Starting point is 00:45:07 Once you get to some like base level I Don't I don't tweak with it that much, you know, I'm just installing a few packages here or there Like I I I extracted all that joy out of it already Getting it to that point and then it's pretty much I'll be like oh there's this new um I was just learning about this command shell history at twin I'll give that a shot installed it uh it didn't work really well right away for me especially you know might not even be nixos I use fish shell might have been like I'm gonna just remove it from my line and move on you know um move on, you know?
Starting point is 00:45:45 And I can do that safely. Like that's the Nix OS. You know, that's probably the most resounding sales pitch I tell is like, you can try, and there's a lot of other tools that let you do this. Try out software, try out a change and not commit. So it's like, I have that fearless mentality. You know, I might have a lot of paper cuts, but I'm like pretty fearless about the change. Right. Like I might get a snippet from Don's infra and I could probably like copy the line. I
Starting point is 00:46:16 want to try whatever he's doing. Like I want that monkey banana click thing. Try it. You know, crashes everything. I don't know why. Okay okay remove it. I'm back to like exact, you know I'll say 99% exact same because some programs can write state you know but for the most part it's fearless and That part's great when you talk about paper cuts and sort of having extracted out a lot of the a lot of that like early fun from it, I think
Starting point is 00:46:49 like a good comparison point it's not exactly the same but anyone who's used a Tiling window manager, which is very very heavy on configuration like BSPWM where you start and configuration like BSPWM where you start and You start with a black screen nothing like that It's a completely useless Tyler out of the box You need to start using the BSPC to write all your hotkeys by the like by yourself Configure how you want windows to be placed and all like any sort of manual Tyler as well where replaced and or like any sort of manual Tyler as well where
Starting point is 00:47:25 It's weird and it might be very strange to someone who doesn't know your system But once you have it at a point where you're happy with it Even if there are still problems, you know what the problems are, you know how to Navigate around those problems so they don't get in your way but if someone else used your system they would immediately realize oh how do you live with this totally and i and i think yeah sorry you're gonna say something don't how about uh what about more demonstrations? Sure, yeah, if you got a demonstration you wanna show off.
Starting point is 00:48:13 It's an example of, let's say, I want to start playing around with a new shell called New Shell. And I do want to start playing around with it. So I will, in some traditional Linux distro, I would go something like apt install new shell or whatever, which is not the case in NixOS. The first thing I can do is I can go Nix Shell, Nix packages hash. Let's see, is it new or is it new shell? Let's try new. Probably not new, let's see, maybe new shell.
Starting point is 00:48:51 New shell. What this does, fairly quickly, is it added new shell from Nix packages to the Nix store. So it's, and you can see my shell level is two. I have this week that shows me my shell level. So I'm in a subshell right now. That subshell has new shell in the path. So I can, now I can, you know, I can have new, I can step into the, to the new shell and do whatever and try it out. You can do this with many programs, with GUI programs as well. Works the same.
Starting point is 00:49:33 Now I've closed new shell and I will step out of this Excel with Ctrl D and I'll try running new and it's not here. But it is in my store. So if I do enter the shell again, it'll be instant. Does that make sense? Let's see where, which, when I do which new, you can see it's not in like user bin, right? It's in the next store under some hash.
Starting point is 00:50:17 It's clean. Right. I didn't bother my system. You have common style, by the way, like I love I think, comma is one that I show off, especially. I was nice. Yeah. You have that was comma. That's. It's a program that typically is
Starting point is 00:50:40 right, it is called my comma is the command. So if you can see, it's quite small, because it's okay. But here's a coma can character and now I can uh something that I uh Uh at atween that we mentioned I don't know. So Lolcat
Starting point is 00:50:56 Yeah, uh, you can see I don't have Lolcat, but I will use comma lolcat And then put a file out So I will use a comma, low cat. And then put a file after. A file? It just cats a file in rainbow. Let's try... Read me.
Starting point is 00:51:16 A read me. Yeah, you go. And it executed from next packages. Yeah, you go. And it executed from next packages. You need to know. What's cool about that is you didn't need to know the package name. You just need to know the binary you want. Right.
Starting point is 00:51:39 You don't need to know next package name. You don't how it works is there's this big database. Like someone has collected all the packages that are built and indexed them and found all the things under bin. So when you write lolcat or new shell, it knows, oh, it's from this package. Oh, I'll just, I'll do this step. He was just demoing before I'll do Nick's shell. I'll download it all into the shell. shell on the kid, but it's like seamlessly
Starting point is 00:52:11 Does that all with comma like it's so seamless that a lot of times There's probably some apps I use daily at this point some of them that I should put in my next OS config I've just gotten so much in the habit of just putting comma in them Like there it's like they're there. I just comma them all the time. It's like, I just, I haven't fully committed, like I want them in my Squasca thing, but I've used them for like a month straight. So I don't know. It's like, yeah. Let's say you did want to put them in your OS config. OK. And this is my desktop.
Starting point is 00:52:55 I would do something like go into the editor here. And LOLCAT, right? OK, so LOLCAT. Where would I put that? Let's say I want lolcat. What is it? I have this module called visuals. Currently, it's about, oh, sorry, this is boot visuals.
Starting point is 00:53:18 Maybe text, no. Let's make a new one, because I don't know where it fits. Let's make a new one, because I don't know where it fits. Let's make a new one. Let's call it, save it under modules. Oh wait, I have something called vanity. I'll say by the way, his config is a little more,
Starting point is 00:53:40 I'm trying to find the right adjective here, but it's like- Advanced. Advanced, yeah. Right, here, but it's like advanced. Advanced. Yeah, that's right. The fact that it's got all these files and you can do one big file and it doesn't need to be so intricate. You know, he's running, he said three different machines, so he wants some modularity and he's sharing things and doing all sorts of crazy stuff. So, yeah. Years ago, I started with one file.
Starting point is 00:54:10 You can go through the Git history, you'll find where it's one file. So I add this locat here. Is it called locat? Yes, and I have nice tooling that I see the version. And I'll save this file. Now I will do nh os switch dot. Uh-huh. Wait.
Starting point is 00:54:39 One of the downsides of Nix is this evaluation time, because there's a step of evaluating this Nix language files into what's called a derivation. That's before that derivation is built. Now that's finished and now the derivation's being built. You can see a nice tree here because everything up the tree must be rebuilt. Does that make sense? Right.
Starting point is 00:55:14 And this is the top of the tree. This is the entire top level OS. So what is this derivation? How about I finish this showing off this little point I want to make and then we can... What's this derivation? How about I finish this showing off this little point I want to make and then we can... Yeah, easy. So here I get a list of changes. This thing, I'm not sure what it is, but it's changed its version.
Starting point is 00:55:41 It's a Ruby file of some sort. Well, it seems that Low Lolcat is implemented in Ruby. So yes, that makes sense. Here's Lolcat itself. These are all additions, added packages. I'll say, well, okay, it sounds good. I've been in my password to make the change and this will apply it. It'll, it'll, what it does, it creates a new generation,
Starting point is 00:56:11 which it means a new, new variant or a new version of my OS and it activates it as well. That's what switch does. Now it's activated. Now I'm already in the upgraded the new generation. And in here I should have locat. I have locat. So let's say pause. Do we want to explain more like let me know if you want to or not yeah we can finish this point yeah but I can show generations what they are okay I was gonna just use words for it that was it yeah if we can do it it's like what is a good better word for a generation I mean it's just a sim link like I was just gonna just be like it's It's like, what is a better word for a generation?
Starting point is 00:57:05 I mean, it's just a symlink. Like, I was just going to just be like, it's just the fuck it's... Can we swear? Yeah, go ahead. Just don't say anything you don't want a recording of. Anything else is fine. Okay, it's just a symlink. It is.
Starting point is 00:57:17 It is just symlinks. The biggest of... I use instead of, you know, you asked what derivation is, I just like, it's just a recipe. Sometimes I use that word and people like attune to it better. I'm like, it's just a recipe file. And they're like, oh, okay. And then we can move on. We can show what they are as well.
Starting point is 00:57:41 So I'm going to add this. I decided I want to keep this change. I'll keep this. I'll commit this. I'll say, look at. I added it. Now I'm committing it. And now I'm pushing it. Oh, it seems like I made some changes. Not a Nix problem. Not a Skate problem. Yeah, because this is actually a good demonstration. I make some I made some changes from my laptop because yesterday I was out. I was at a cafe and I was using my
Starting point is 00:58:11 laptop. So let's let's do a git rebase origin origin name. That should solve the problem. It did it so. Log here. But I'm behind OriginMain. Now we're dealing with git instead of mix. Yeah, it's the podcast. I needed to fetch. Now it's successfully rebased and now I can push it. Now... I needed to fetch. Now it's successfully rebased and now I can push it. Okay.
Starting point is 00:58:47 Now, because I put it under what's for me is a whole manager module called base, which I use in my laptop as well. All I need to do when I open up my laptop, Sunday when I go somewhere, is pull, is git pull. And then, I'll do git pull there, and then I'll do n, n-h-o-s, switch.
Starting point is 00:59:30 there and then I'll do an NHOS switch dot and I will have the same change from my desktop. I gotta use that tool. I don't use NH. It looks pretty cool. I recommend it. Shall we demonstrate what generations are? Sure, yeah. So I think I wrote this little tool for myself called Generation Manager. I need to run it at root. Because I don't remember the invocation of what you could do is if you say which of one of your programs, the first thing you're going to do is your next profile.
Starting point is 01:00:16 And then that profile, it's just a tree of siblings. Nick's summer like no, but just do which way you want me to do which locat and then... Yeah, there you go. So you can now... But my generations for the system are system ones. They're not in here, right? I think it's going to go to there. with profiles system. And is that it?
Starting point is 01:00:55 Somewhere. Well, I can find out if I look at my generation manager, it's implementation does, this is Nix var nix profile system and what it does is called nix and with profile list generations so that's the that's like the it's next and to do nix and profile system or is it the entire path? Nix, var, nix, sorry, profile, Nix, var, Nix, profile, system,
Starting point is 01:01:37 lists, generations. Okay. Let me, I don't know, like... Nix had a few huge ah-hahs. Okay. And one of them was... There was something that was like a base problem before Nix solved it, called the multi-file update problem.
Starting point is 01:02:02 Do you want it to... Let me know if this is getting too pedantic. No, go into it. Great. So they wanted to, you'll see, I'll tie it into this and then you'll be like, okay, that makes sense. So there was this problem called the multi file update problem. What do I mean by like that? You know, you want to do app, get whatever install, you're downloading more than one file. If you're installing them all onto your machine at one time, you have this problem like imagine if the power cord gets unplugged, you're left with like an inconsistent state, right? You've updated one file and not the other. And our PM app get then they ended
Starting point is 01:02:42 up solving, they sort of solve this by like trying to track and then they roll back and they have all this like state tracking and it's incredibly complicated. Nix's beauty one second I do still need the the visual here um or can we close the window capture sweet okay cool yeah oh yeah keep going yeah. So Nick's beauty was by solving this with again, base primitives. So they saw Nick solves the multi-optate file problem. And how it does that is the realization through the use of SIM links. So I'm going to talk about it and you can let me, we could demo it if it's not clear with talking about it. The premise is simple. You want to install three files, make a temporary directory or in this case in the store, it's not clear talking about it. The premise is simple. You wanna install three files, make a temporary directory
Starting point is 01:03:27 or in this case in the store, it's not really temporary, shove them all there. And then once you're guaranteed everything got downloaded, cut over a SimLink as your final step. That SimLink cut over is atomic. Like it either worked or didn't, it's your last step and then you could report your six. And because it's atomic and you're getting all the files all or nothing, you're never in an inconsistent state. And it's that concept that that's what a generation is.
Starting point is 01:03:56 Every system is just like when he did that rebuild thing, it made a new folder, put everything in there. Oh, you know, you could have pulled the power plug, doesn't matter. Gets tossed away, we didn't change anything. Okay, this time we didn't put power. That's everything in this folder. And then it says, I finished. And then it cuts over the SimLink to this new thing. And that SimLink is like your bin.
Starting point is 01:04:23 It's the root of, you can think of it as the root of your file system, the bin, the everything. So suddenly all your bin paths. Like now find Lolcat because it's pointing at this brand new route. Um, so I just found like generation, you know, and then, so generations are just like all these previous folders that you've just SIM linked away from. And that's why Nix, you could, you know, like, it's kind of unnecessary now with Git, because you can kind of just like, keep rolling forward by rolling back, you can just check out
Starting point is 01:04:55 an old commit and rebuild it. But Nix lets you say, like, pick any of these old ones and point your SIM link back to it. And just that old machine. So that's like, I keep thinking like, X took all these like really basic, that was what I thought was the beauty. He saw the landscape, Ilco, and he said, this is what I have available. You know, like he wants to radically redesign software. But they said, like, given what's available, what can we use? So there's a lot of pragmatism in it. And it's like, I got SimLinks, I got this other stuff. He's got a couple other cool things.
Starting point is 01:05:35 Maybe a little too nerdy that they do, but yeah, such a simple thing. And then like, that's what bleeds out of it. But if your machine don't boot with a new generation, right? Because you made a, it has a new kernel, it has an incompatibility with some of your hardware, it doesn't even boot. If I do a NixOS rebuild, I use NH, but the canonical one is NixOS rebuild switch, then I don't get to use the new kernel yet. Right.
Starting point is 01:06:07 But let's say I did a switch and then I rebooted as well, and it doesn't boot. Well, my bootloader has a menu entry for each generation that is still on my machine. for each generation that is still on my machine. Mm-hmm. So at boot, I can choose which generation of this OS I want to boot into. Mm-hmm. That's a lot of...
Starting point is 01:06:34 That solves a big, big problem. I remember PewDiePie saying I had a problem with my graphics driver or something. Yeah, he's an video user on his laptop. And I had to reinstall the OS. And we NixOS users are... Nix solves that. Nix fixes that. I have not reinstalled for so long. This...
Starting point is 01:07:03 This installation, this desktop installation, I think I've been rolling it with it for, um, for a few years. I, I've even transferred it from one storage device to another storage device. Have you tried impermanence Dawn? I've never been that zealot to do it. No, that's very much an extra extra extra feature. What is impermanence? It's a mechanism that can be added onto NixOS where if I don't specify what paths should be kept,
Starting point is 01:07:59 where I store my data, my state, my home directory would be one of them, or subdirectories in the home directory would be one of them or subdirectories in the home directory would be some of them. Then everything else will be wiped at boot. Okay. But it's kind of an OCD, keep my system fresh kind of mechanism. Right. I don't know what it's for really. That's a bit much for me.
Starting point is 01:08:29 It's for like proving, because even with NixOS, it's easy for you to have impurities. You know, like you might have relied on some state file that you didn't mean to or something. Again, it's like these like, it's also a bit of a pyramid game, right? Like we're constantly trying to outdo each other in this community, I guess, with our zeal for purity. And so that is a mechanism, like he explained, that like you shut down your, when you turn off your computer on every fresh, it's like starting from a live CD, brand new, right? Fresh car smell. You saved a file and you know, you didn't tell it to save that file.
Starting point is 01:09:12 It was gone. It's gone. Right. So like there's no way in between restarts for you to maintain any impurity because like that impurity is gone. So like really quickly, you're going to face like this thing was working last boot and now it's not How come? And eventually get it to the point where like if it works it's it's quote unquote, you know, it might be neat that it's Then you could like tattoo your arm that like State free or something. But yeah, you have white, you end up with a white list of paths that, you know,
Starting point is 01:09:50 here my state lives here and only here at the state that I care about this. That can be valuable for some, I suppose. Correct me if I'm wrong here, but I, sorry. Got to choose. I, I got to choose. We if I'm wrong here, but I, sorry. Gotta choose, I gotta choose, we all gotta choose our battles. Right. Like I said, I wanna switch over to Hyperland. Am I gonna do this or impermanence?
Starting point is 01:10:14 Or am I going to change my notification app or my launcher? Or am I going to work on this next ecosystem contribution? I've got to spread myself in some ways. Correct me if I'm wrong here, but it sounds like what you're saying is impermanent is kind of like every boot you swap to a clean new generation. It basically just deletes files. Right. It does not pertain to the generation.
Starting point is 01:10:49 It simply deletes every file. And we're not talking about the files that are part of the OS build. Those are not, those are put aside, those are not touched. Okay, okay. Every file that is... Other than those files. Every... Everything else is deleted. Other than that, what you have whitelisted.
Starting point is 01:11:16 Okay. This sounds like it would make a lot of sense in... Like a system administration context. Say you're managing a bunch of school computers and you want there to be a specific location on the drive where students can save whatever data they need to save and everything else is just wiped clean on reboot. So if they do try to mess around with anything,
Starting point is 01:11:41 it puts the system back into a known working state. Yeah, I suppose. Probably use permissions for that use case. Okay, sure. I think this is more for cases where you want to be pedantic about, and you don't want to be like surprised, oh, I actually had state in that directory that I cared about.
Starting point is 01:12:12 Right, right. Because some server is maintaining some, writing to some files for some reason. And when you, let's say I need to now take this appliance and move it to a different computer, different machine, a different storage device. If I use impermanence, I ended up with a whitelist of all the paths that I care about. So I know what paths I have data to migrate. Okay, fair enough. One of the topics that came up earlier that I do want to sort of address more in,
Starting point is 01:12:56 there was the discussion of how there's not the NixOS book, there's not this really nice onboarding process to bring someone up to speed. And this is something I often hear about Nyx where trying to understand how it all fits together turns people away quite quickly. Gosh, there's say you just have a ton of free time and you could say I'm gonna do all of this stuff to Bring things up to the state. I want it to be what things would you like to see existing? To make that process a lot easier for people But resources I would like to have exactly yeah, what, tutorial, what would you like there to be to give people a way to at least get their foot in the door and begin understanding this before they start
Starting point is 01:13:56 delving into some of the more complex configuration like you have on your system? It's such a difficult question because as a NixOS user, I have to be a Nix user. I have to learn some Nix commands and there's a lot to learn there. But the best resource to learn Nix is probably nix.dev. If you go there, what you'll see is, because Nix is a tool for software development or for software composition or for building software. And so those, that documentation will be written for software people, not for Linux PC user. And that can be off-putting, but this is the tool and this is what we got to learn. So if maybe the resource that I would like to see the answer to your question is documentation for NixOS that teaches only what is necessary in terms of Nix in order to get started with NixOS.
Starting point is 01:15:27 I wish there was such a thing. Can you guys hear me? Okay, I switched to my headphone. Yes. Okay, cool. But I think that the line we got to, not like we, but an interesting line to follow is not trying to be the everything system for everyone like distros already have
Starting point is 01:15:49 Channels, you know Someone that wants more control like the archwiki is great, but it it it veers more system Administrator someone that knows the guts a little more, you know same with gen 2 versus something like uh, yuban 2 so I don't know, like. I mean, I don't have a say in this at all, but this is just me like prophecy, you know, hypothesizing. Should Nix OSP have manuals that are like that accessible? It's I mean, it's fundamentally pretty complex, like it's doing things.
Starting point is 01:16:23 So it could definitely be more Welcoming to even the group it's trying to The tailor for which is like a more system administrator mindset but um, I don't know I just I always try to tamp expectations or like It's not like it's trying to be the next macOS. At least to me, right? Like that's, that's like a really closed down system. You're not meant to change it.
Starting point is 01:16:52 And at trade-off means it's incredibly easy to use. So the fundamental thing here is like, we're letting you change any knob. So there's like a ready already some starting off complexity, you know, so definitely skews power user and I think we'll always do power user ish. And I don't know. Maybe someone the next was marketing teams could like, don't say that. I think it's true.
Starting point is 01:17:22 So I don't know. I'll say it. So now, so the don't know. I'll say it. So, yeah. So, the next language. You can't avoid it. You can try to avoid functions and use only addersets and lists. It's possible. It's possible. But, and maybe you can do that and then move forward, but those functions are not, I think what we need, and actually I've started recently, yesterday I launched a stub for that. I found a lot of great value in the way that I have the pattern that I follow
Starting point is 01:18:09 in my own repository, which is public, that I shared it a few weeks ago. I shared it. I called it, I named the pattern and some people decided that it's a great idea and they spent hours and hours and hours converting their configurations to use this pattern and that inspired me to some of them even suggested it. Let's make it something. Let's make something of it. Let's make a homepage for this and start documenting it.
Starting point is 01:18:57 Because so many are coming into this, interest is picking up. This is what we're doing now, right? In your show, Brody. And people are going to try to use it and they're going to go through this pain. There's a lot of learning. And if we can create resources, templates, perhaps a template, perhaps show them here, you can clone this repo and start tinkering around with it. And here are the set of commands that you need to know.
Starting point is 01:19:41 Here's how you build your system, rebuild your system. you know, here's how you build your system, rebuild your system. And maybe resources like these can help. I have actually a really good resource. I think you're going to agree with me, Don. Nix, unlike any other distro, you get because it's code based. I will just go into code search on GitHub, cs.github.com, write lang colon nix, write the thing I want, and just endlessly browse settings, how they set up their machines, I'll learn little snippets.
Starting point is 01:20:15 There's no other distro you're doing that in, right? Yeah, that's great. The problem is, and this is like, I don't know the right way to solve this, is on one hand it's great. GitHub has like amassed most of the open source stuff, right? Good or bad, however that falls out. The code search on GitHub is good, but when people don't put it on GitHub, I can't search
Starting point is 01:20:44 it. If they're on GitLab or some other forge, it's like not searchable at all. And I'm not learning from the thing. Now, I don't know, do I want to put them, you know, the easiest would be to say move to GitLab, GitHub, sorry. Maybe they don't want to because they have some personal philosophy. They don't want to show it. It may be a meta code search. Taylor just for Knicks.
Starting point is 01:21:11 Like to me, that's even more valuable than written pros documentation that connects all these other forges where people could just register their Knicks repo and I could search, like I was setting up also my VS code and I was just looking up all the different ways patterns people are setting up their code to set up VS code and I was you know just going through a hundred there could have been the one I really wanted was on GitLab and I missed it who knows so some meta code search tool I think would be huge So some meta code search tool, I think, would be huge. So like a nixexamples.com sort of deal. Where it's like,
Starting point is 01:21:49 But not static. I'm searching live. Right, right, right. There's live grep, I think, that lets you search the Linux code base. Standing up a live grep instance for all the different NICs, and usually these like code search tools have like, they know the language,
Starting point is 01:22:11 they could do symbol analysis and all the fancy stuff he was showing in his editor, the versions, maybe we could do, it could be custom tailored to NICs to let you browse it. And that would be, at least for me, like, so I don't know. Yeah, maybe not like super beginner. I think really quickly after you have the basic material, you're just in like, absorption mode, like I need to see 1000s of patterns because there's personal taste. Like he mentioned, he just is advocating this new one. And it's, you know, not necessarily this new way to build a system.
Starting point is 01:22:53 It's gonna be one of many. And they're each gonna have their pros and cons and next lets you, you know, and you can read about them, but you're gonna want to and someone might come up with a new one. See, like, there's just so much fact finding. That's good and bad. You're like, I like seeing all the variations and then plucking out one from obscurity like I love that. I'm going to use that in mind now. So something that would make that easier.
Starting point is 01:23:21 That's a great tip. Going to GitHub. make that easier. That's a great tip. Go into GitHub, turn the language to set the language to to Nix lang or Nix and then search for PS code or whatever it is you're trying to set up for yourself. The greatest Nix expert, this is often not about Nix. The problem we're trying to solve is about, I don't know, the work around some issue that a program, that an application has. Let's see how others might have fixed this.
Starting point is 01:24:02 I've done this countless times. So, you're sort of shifting gears into another topic. One thing that I often hear about with Nix is the concept of flakes. And I don't fully understand what a flake is and what the value of Just what just we'll go from that like what what are flakes and why? Why do they exist and why would you use them? Or anyone just listening just like shaking his head Lakes are They're problematic because they are not a single feature, right?
Starting point is 01:24:56 Ideally historically and I think everyone in the ecosystem Or most in the ecosystem would agree that or most in the ecosystem would agree that releasing this feature set with under one name called Flakes was not the brightest idea. I think in hindsight it had been more useful to cut this down and multiple different features and then release them incrementally. So that's why I can tell you what is the feature set that is in Flakes. One of it is that by default the evaluation of the Nix language is pure. One of the implications of that is otherwise by default, we're not using Flix, the evaluation is, even though the idea of Nix is to have pure evaluation. I don't know why historically evaluation is not pure.
Starting point is 01:26:09 What it means for example, is that in impure, you can read environment variables in the Nix language, which means the evaluation depends on something other than the Nix code. That's impure, some one time you can set this environment variable and you get one result and then I send it to my buddy and they run it and they get a different result. Theoretically, how many times this actually happens? I don't know, but it's clearly a better idea to have pure evaluation.
Starting point is 01:26:47 And in Flakes, evaluation is pure by default. Another feature of Flakes is that there is Flake inputs and outputs. It's part of a schema. It's actually a partially defined schema. The part of it that is strict is that there are inputs and outputs and there's a lock file that locks those inputs. There's a log file that locks those inputs. I can define, may I show? I think it's best to show.
Starting point is 01:27:33 I am using Flakes pretty much all the time. Did I share? There you go. When using Flakes, there must be a Flake.nix file. And here is the Flake.nix file of my same repository where I have my configurations. You can have a little bit of config here. You must have some, you probably have some inputs, because otherwise it's not very useful.
Starting point is 01:28:04 For example, if I search around, there should be a, find it this way, here. Next packages is the most significant input here. You can see it's URL is defined as nix packages, which is actually equivalent to GitHub, colon, nixos, slash, mixpackages. Right. And then this is a branch.
Starting point is 01:28:31 If you remember the graph, this is the most recent branch of Nix packages that is cached. It has public cache. If you use Nix, if you use master, then you probably have to build many, when you do a NixOS rebuild, you probably end up locally compiling frequently things, whatever, the Linux kernel, anything that has been updated on on master since it reached the next packages unstable. So typically a desktop like PC desktop
Starting point is 01:29:22 user would want to use next packages unstable. see desktop user would want to use Nix packages unstable. These are inputs and I have lots of them. Nix on Droid is a fun little thing. Nix index database has to do with that coma program we saw earlier. Here's home manager, which is the part that's us manage user home directories. So users have, they can have their own programs and their own configuration
Starting point is 01:29:50 files managed as well, not only the operating system. I think we should touch on like why. But before Flakes was even a thing. You'd import Nix packages in another way. Maybe you can demo it later. There's an import command. It doesn't matter. You can show it. The original problem was, and you might have your code and you'll import Nix packages at
Starting point is 01:30:20 a particular version. And you want to depend on another piece of software outside of next packages. They might also like everything needs next packages. So they probably also import next packages. So now I want to build my piece of software. I've imported next packages, they imported next packages, maybe I have a third piece of software my god, they they imported next packages. I have three Nix packages. Nothing's actually wrong with that. Right. Everything could work, but it's very, very large. Right. Is one problem. So I think he he hit the nail on the head. It's like a bunch of features. But one of them, when it starts to get to the schema was the capability
Starting point is 01:31:06 to also say, I'm going to have one next packages. And when I start to import other things, I want you guys to use this one next package. Now that's good and bad. Like a lot of people tend to do that because we value more sometimes space. I just want a nice one graph. You know, the trade off here is you're changing what someone said they've tested it against. There's this software author and they said, I've only tested it against Nick's packages 2311.
Starting point is 01:31:43 And I'm saying, no, use 24.05 these are released versions you know and consolidate them all to this one. Flakes makes that very easy. You could do this the thing with flakes is you could do everything without flakes that's what like I mean I just use flakes now also because I was the like longest holdout. It just makes a lot of these things easier to do, you know, but I think that was one of the big ones. So schema and stuff. But I just wanted to me that was like one of the big ones.
Starting point is 01:32:19 That was like why I think the impurity was also another really good one. He meant you mentioned. But yeah, even in before flakes and without flakes, there's still there are ways to pin dependencies like mixed packages or whatever else other other repositories I'm bringing into my evaluation. And so there are ways to not use Flakes and that's fine. This Flakes provides a certain built-in
Starting point is 01:32:55 mechanism for pinning dependencies and we saw that for a moment in the lock file there. It's automatically generated and it will pin the dependencies to Git revisions and it can be bumped. That's what I do occasionally in order to bump. Would you like to see a demonstration of what it looks like to bump my bumping MixOS configuration, bump to see whether there are updates? Sure, let's do that. Okay, I need to click more than once here in order to share the screen. OK. OK.
Starting point is 01:33:45 So I'll go to Infra, repo. I'll cancel this. I'll restore. Do undo the change that I made. What I need to do is next update. This will bump all the inputs. But the most significant one is next packages. That's where most of my software comes from.
Starting point is 01:34:18 Here it is downloading, just finished. Here it is unpacking and copying it to the store. And I get a report of a NUR. This is like AUR. This is NUR, Nix user. Right, right. And repo is Home Manager, Nix packages, and Nix Vim. That I use to configure my Neo Vim with.
Starting point is 01:34:47 The inputs have been updated, but I didn't use, I didn't rebuild anything yet. What I'm going to do is I do nix check. Let's make it verbose. And this will check all of the checks. It will build all of the checks that I have in this repository, which include two desktops and a laptop, and the code formatting, the code style in this repository and some other less significant things.
Starting point is 01:35:32 I find the biggest, we've been so focused on NixOS and I think that's been great. To me, Flakes and NixOS is a bit more of a non-starter, like just use Flakes. Sure. But for another big avenue, people get into Nexus for project development. That's a whole nother. Also podcasts, you can like write a file and do all the next stuff, but for a repo only. And that had, I think where you, I think at least my own personal History with flakes why I was very slow to come around was the project way to do it was much easier before
Starting point is 01:36:14 like flakes has a lot more ceremony and Used to be able to just write something called like a shell a shell dot next file That was way simpler. You just it looked more like a file. You just threw the packages you write something called like a shell a shell dot next file that was way simpler you just it looked more like a File you just threw the packages you wanted and called it a day instead of like all this input and lock files and so And you know, it didn't seem like you got much more out of it XOS just everything just tends to when you start up a new
Starting point is 01:36:42 Everything just tends to when you start up a new OS you're probably starting from flake. So it's like that's why I think less of an issue, right? I think people are making it now more of an issue than it is. I mean they've published stats at all the Knicks cons. It's like Mostly because more of the users have started off now like communities just growing insane like exponentially now, like the community is just growing insane, like exponentially. They only know flakes from the get-go. Right. So it's it's user base, like is. Very huge. So it's almost comical that it's still such a.
Starting point is 01:37:19 Intention, it's just for like old farts like me that like had our old way of doing it. And we're like, it was fine. But, you know, even me, I'm like, it's whatever, you know. were like, it was fine. But you know, even me, I'm like, it's whatever, you know. Personally, being someone from like outside of this space, I'm not even aware of this, like the fact that there is issues regarding whether you use flakes or you don't use flakes. Like the only time I ever, like I hear about the concept of a flake, but I never hear about any of the any of that additional stuff that goes along with it I think that's that's why people who are getting interested in it do ask about it because they hear about people arguing about it
Starting point is 01:37:55 but they don't really know like especially if they're seeing a new system where flakes are there from the start they don't really see why this is a point of discussion to begin with. So they're kind of interested in, in, in why this is happening. Oh, and I mean, you have to enable it too. I think that like, they're like, this is my default. I think that's probably it too. It's like, it's the default for us all. And it's still experimental or whatever is the label. And you have to like explicitly enable the feature set. So, and that's this, that's probably the real,
Starting point is 01:38:38 or fuffle. But yeah. You may have noticed that a check failed here and this check is telling me that Actually, I didn't have formatting that is not well, I think I did this yesterday and I did not do a check So what I'm going to do is get stash my log file changes and then run it sorry a mix front to format all the files now I'm
Starting point is 01:39:08 going to add this formatting change omitted say oops and get stash pop you have my lock file changes again and then I'll run nix flake check again. And this is a good demonstration of after the evaluation that will occur, none of the build steps that finished will run again. None of the things that have been downloaded will be downloaded, of course. We're not going to do extra work now. Right, things that have already been confirmed as good, you don't need to do again, basically. Yes, you have to trust us on that. It's tough to prove when it's like zooming text, but like... Sure, sure, sure.
Starting point is 01:40:02 Tough to prove when it's like zooming text, but like, sure, sure, sure. One of the things to note here that I find noteworthy that during this Knicks Flake check, two desktops and a laptop will be built and will end up in the next store. Which means that after this is hopefully successful, the commands to switch to this new OS generation will be instantaneous because they're already in the next store. Minus the evaluation, but yeah. With Flakes they get evaluation caching, so that will be instant as well. Way to pull out another plus for the flakes right there.
Starting point is 01:41:13 So how long would this process normally take? Like, is this longer on his system because of his advanced configuration or like, what's the process here? Oh, it's finished. Uh, it, this is for example, this one, uh, package GNOME session, uh, was rebuilt. Uh, some things here rebuild because I'm using Stylix, which I totally recommend. It's a project that applies the same color scheme and the same fonts to a great number of parts of the system and applications in one go. Right.
Starting point is 01:42:05 So everything gets styled. So I think the way it works is that it has to rebuild some packages. I'm willing to put up with that. As you can see, this didn't take too long and it succeeded. So that's nice. So what I'm going to do is take a look at the git status here.
Starting point is 01:42:26 That's what I've expected. The only thing that was modified is the flag clock. And now I'm going to do nh os switch dot and hope that nothing significant enough occurs that it breaks my connection to our call. Or my audio, or my screen share. I get this summary again where I can go over the packages that were changed, the diversions. Normally I would give it a little bit more attention, but since we're on a call I'll just say, oh okay, get some updates. And here is where the actual switch occurs. Now I saw my screen flash. I thought we lost you for a second there.
Starting point is 01:43:32 It restarted his network. Okay, that makes sense. You know, like, the rebuild can take dependent, everyone's configuration is going to take different. Like, I have some personal software in mind. So when I change some stuff, sometimes I'm waiting way longer, like recompiling everything. So it's like tough to say what if you're doing no customizations whatsoever,
Starting point is 01:43:59 everything should just be downloaded off the cache. But pretty quickly you end up tweaking something and then really quickly recompiling. And if we run this list generations again, command you can see, and I go all the way to the end, you can see that we have one from, this is my time. So this is the one we just built. And it's the current one. It's kind of the current one, because if it had the new kernel,
Starting point is 01:44:29 I would not have been running it. So I've not switched the kernel in the live system yet. And that's that. That was bumping the inputs on an XOS. With flakes. With flakes and with... Yeah. So there's one last big thing I do want to touch on, and this is honestly could have just been an entire episode unto itself, but here we are anyway.
Starting point is 01:44:59 So I want to talk a little bit about reproducibility. This is a topic that is, a lot of distros are working on, and I often hear the idea of reproducible builds and Nix in the same sentence. Nix makes a good effort to produce very similar artifacts, but it's not as strict as to try to produce the same artifact every time. What will be the same every time are the build instructions, what's called a derivation,
Starting point is 01:45:44 that recipe. That is the completely reproducible part. It means the next language code that I write will deterministically get turned in, evaluated into a the same derivation every time now derivation is a recipe for how to build whatever artifact that consists of
Starting point is 01:46:20 typically a bash script Typically, a bash script with all sorts of dependencies, because you need a compiler, you need some libraries. But Nix has no control over the programs, the compiler, what it does. Nix can specify, I want exactly this compiler, which or the recipe to produce that compiler actually. So every time you build something, it may or may not be exactly the same artifact.
Starting point is 01:46:55 For example, if for some reason, the time, the current time is used in the build artifact, it will never be the same. And Nick says, okay, this is reasonable. We're aiming for that level of reproducibility. We want to reproduce the build instructions. That's a reasonable thing to do. Having said that, that's the default kind of derivation.
Starting point is 01:47:32 For other kinds of derivations, we can force complete reproducibility. And we want to do that in some cases. The most common case we want to do that in is a derivation that is the purpose of it which is to fetch a remote resource such as fetching the source code of some program. When I fetch the source code of some program from github or from a tarball somewhere, I want to make sure that the exact contents are verified every time. It's exact contents every time. So this is a security, right? Like let's say I manually checked out that source code. I reviewed it. Maybe a team has reviewed it. I don't know what context we are talking about. And this is known safe, known good. So Nix will, Nix provides a means to make such derivations where they're called fixed output derivations because their output is fixed
Starting point is 01:48:37 and it's fixed using a hash of the content of that derivation. And we again have to use that for fetching. So I'm sure there's a lot more we could definitely cover. I'm sure there's plenty more about Nix to say. If there's anything that you feel like is very important we should address before we end. Let me know and we can touch on that. Check out nyx.dev. Feel free to ask questions in discourse.nyxos.org or on discourse.nixos.org or on the unofficial NixOS Discord. The matrix, NixNixOS matrix, there are many rooms. Unity is making heavy use of the matrix network. And there's also a NixOS Reddit.
Starting point is 01:49:53 There are actually several. And there's a Zulip recently. It's called NixOS Asia, I believe. I do want to show a meme before we finish. Let me just find it first. While you do that, I'll share my little blurb. I was kind of at the start a little, you know, maybe don't worry if you don't want to use Nick's or whatever, but at the same time, you know, if you
Starting point is 01:50:31 want to use Nick's, don't be put off that you don't get it. There's still like, I'm like eight years, 10 years since using Nick's and actually I was looking at Dawn's that new pattern he he was talking about and I don't get it. Like the Nix is like, you need someone to hold your hand a lot of the time and there's no shame in that. It took me like, I don't know, five different attempts to learn it until I finally got it. It has that same feeling of like when people used to have
Starting point is 01:51:03 install parties for Linux, cause you needed someone to help guide you through the process, but there was a lot of reward. It's a very passionate community. It's fun. Like it's just straight up fun, which I think has that excitement and joy. So if you're looking at it and you're like, gosh,
Starting point is 01:51:20 it doesn't have this self starter feeling. I can't do it. That's okay. Find a friend I'm so just ask like people want to help you like I help white glove people into Nick's OS systems all the time you know they call it red pilling and to be red-pilled like you have to be handed the pill like someone has to write like Morpheus gave him the pill. He didn't take it, you know, you don't just find it yourself and take it. So, you know, don't worry about that.
Starting point is 01:51:53 Yeah. Here's the meme we wanted to show. Okay. There. I hope no one gets upset. It's just all in good humor. Obviously I like it because I'm an ex user. This is based off of an incident that happened at sea where this is a pirate. This man's a pirate and this man's maybe the captain of a ship and they, pirates boarded
Starting point is 01:52:40 that ship and the man said, look at me, I'm the captain. Mm-hmm. I think most people have probably seen the meme for that. I love the, I mean, Nix loves taking like all the arch memes like that one and just taking it one step further. Like there's the one with the like increasingly large beards that go to, have you seen that one and just taking it one step further. Like there's the one with the like increasingly large beards. Have you seen that one? It's like Bantu, Debian, then it all goes to like Linux from scratch,
Starting point is 01:53:14 you know, it's down to the floor and then like Nix is like, you know, endless. So I love that. Man sitting in their own beard. Yeah. So, I love that. Mm-hmm, mm-hmm, mm-hmm. A man sitting in their own beard. Yeah. Okay, well... I shaved this morning. Hehehe. Uh, I think, as I said before, I think there's definitely more we could talk about for sure. But...
Starting point is 01:53:51 I hope that this has been a more approachable episode on Nix. And I hope that some of those terms that were used last time make a bit more sense now. Especially with the graphical demonstrations of... How some of these basic things work like doing that switch Actually building everything Looking at the the Nix files and how these modules work. I hope with all that it does give people a better understanding of How this all fits together and I can't speak for anyone watching but at least for me I I do think I have a better understanding of what is going on I'm look I'm still happy on the arch I'm happy on my system I'm
Starting point is 01:54:29 I'm not gonna use nix anytime soon I've got some laptops sitting off my shelf maybe I'll maybe I'll chuck nix on one of those at some point and give it a shot um but I I do think that it makes a lot more sense now. And I hope that people watching this get that feeling as well. Yeah. If you want to ask, I'd be happy to, maybe if you want to have a machine that you would like to try NixOS on I'd be happy to come on and walk you through it. Or find someone what me and
Starting point is 01:55:13 my one of my best friends we do is we bought the exact same laptop like everything and we share the exact same config and it's like, kind of like, you know, you know, so when I open up my laptop, I see his user and we use tail scale, whatever it's this like VPN thing and he'll just SSH because he has a user on my laptop with his password. Right. Like I'll be on my laptop and he'll just SSH in and right on my wall, you know, like send me something on the wall. And I just think like you could do really weird, fun stuff like that. So you're just one peer away from finding your Linux, your, your laptop soulmate, and then you can have the same config as them.
Starting point is 01:55:59 So I don't have plans to do that, but that does sound fun. I don't have plans to do that, but that does sound fun. Um, I guess, um, we'll just, yeah, where can people find, like, I don't know if you have much of a social media presence, uh, for it, but, uh, Shahla, like, uh, don't let people know where they can find your show. And, um, yeah, yeah, if people want to go low, more about Nyx. Farid has a blog, he's been writing advanced, even esoterical things about Nyx. If you want to drag people to something, if you've got a blog that you want to talk about.
Starting point is 01:56:39 I forgot about that. You guys are doing, you're going to do good marketing for me. My blog, I do write a lot about Nick's it's F Zicaria. I don't know if you could write it in like some show notes or something. Yeah, yeah. Right. Description. I write pretty approachable. I am a endless idiot is what I like to think.
Starting point is 01:57:00 You know, I like to break things down into like really basic. Primitives, and that's what I like to write about and Yeah, thanks for reminding me But either think you are an out-of-the-box thinker I would have never Tried to write about stuff that you write about interesting blog if you want to get deep into the bowels of Nix. I recommend it. What about your own stuff? My primary online presence is github.com slash mightyiam. And Mighty I am, Mighty I am.
Starting point is 01:57:49 And my podcast, fulltimenix.com. Is that just on the website? Is there an RSS feed for it and all that? It's pretty much in every podcast app you can think of. Awesome. Nothing else either of you wanted to mention Luck with Nick Swiss Perfect I'll do my outro and then we can sign off. So my main channel is Brody Robertson I do Linux videos there six days week. Sometimes I also stream
Starting point is 01:58:23 Check that out. If you want see. I did a cosmic stream recently. That's fun. They're always fun to mess around with alpha software. I've got the gaming channel, Brody on Games. I stream there twice a week. Right now I'll be playing through Ori and the Blind Forest and the first Berserker Kazan. Very fun games. If you're watching the video version of this, you can find the audio version basically on any podcast platform There is an RSS feed as well, which is cool Spotify has video Which if you care about that if you're listening to the audio version of this I would recommend going back and looking at the video. There are a lot of visual demonstrations that I think are valuable
Starting point is 01:58:59 That is on YouTube at tech over tea That is on YouTube at Tech Over Tea. So I don't ever tell people they're doing this, but I like to let them do the final word and sign off the episode. So what do you wanna say? Thank you for listening to Tech Over Tea. Please like, share, comment, subscribe, rate, and do you take sponsorships?
Starting point is 01:59:26 Yeah, I don't have one right now, but I do. Then consider sponsoring Brody. It's excellent content. Thank you for having us here Brody. I'll do this again anytime. Likewise. Awesome.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.