Hey, guys. I have a little bit of a live demo, so there's a lot of things that are probably about to go wrong. I got this maybe working, like, five minutes ago. My name is Britton Robich. I've been in Nix, doing Nix stuff, for about two or three years now. Some with work, some for personal. Some mix both. But one of the issues I've always had is deploying multiple machines, and especially among multiple users. And at PlantNix, I found a... it's called a framework. I like to think of it as, like, NixOS for teams on Rails, almost. It's called clan.lol. And it's basically a framework that combines a few community packages, like Disco, NixOS Anywhere, and SoxNix. It makes it easy to deploy lots of services, however you want. Very modular on many machines. So with me, if you can see this, this is a little Mac, like, micro rack with three little mini... three mini PCs. They're all networked together. I have my laptop on it. So basically what I'm going to show is PixieBooting three different mini PCs with a custom image, and then updating those three machines with whatever service we decide we want. For this example, we're going to use, like, the typical monitoring stack with Prometheus, Grafana, and those are going to automatically just pop up because I have the service added to all three machines. And then I'll show you some more of the, like, clan-specific stuff as well. So let's get started and move into all these. So this is just loading up the netboot image that I've made and hosted on my laptop right now. So I'm not going to keep switching back between the three mini PCs. We're just going to focus on this one for now. But we're just putting it into a normal NixOS installer. The only main difference is it's using the netboot boot module and then something called NixOS Factor, which is a community project. Same guys that make SocksNix and Plan. I think it was made for Plan. It's basically an alternative to HardwareConfiguration.nix. And it's where you can define all the hardware in a machine before you deploy it, which is useful for this scenario because in a deployment like this, you preferably would know all the disks beforehand. And so we can generate templates using the disk information that we can get from those machines before we actually install NixOS. How do we do that? Typically, you just KXAC into it. Or the Plan installer will KXAC into their custom NixOS image, which has NixOS Factor, pulls that factor.json down, and copy it over SSH. The main thing for Plan that you would need to know is this disk ID here. What that's doing is whenever we are first installing Plan on a machine, you want to create the disk using Disco. And they have nice little templates. And you can see here, there's just some variables that get replaced by the actual disk ID from NixOS Factor. All right, so we're in our netboot image. Let's actually get NixOS installed on these. I'm going to run a command. It's just a built-in Plan CLI. Installing the three machines with our specific Plan configuration. We'll get into that briefly. Let me just get this started to hopefully not having issues. Cool, cool, cool. Yeah, live demos. All right, let's see if this will work. If not, we're skipping it. We're just going to explain Plan. All right, we're going to come back to it. So, Plan. There's a few different components that make up Plan. It's kind of their secret sauce. You have the bars, which is variables, which is very nice. It's where you can share secrets, values, between any of your Plan machines. You can actually add a lot of ACL rules to that. So, by machine secrets, by user secrets, or you can even share them between whatever combination that you want. So, for example, these three mini-machines, mini-PCs, have these variables that will be injected into the NixOS configuration whenever we update or install. You can see here, we have SSHKey, and then TailScaleHothKey. These are both secret variables, and both of these are shared between just my user, so the BritnR user. On this, we also have a few other users. We have Alex and Dima. And looking again, you can see my BritnR user on the machine is the owner here. Sorry, let me step back. Plan has users, and you also have your system users. I'm going to refer to these as plan users and roster going forward to try to help with confusion because words are very similar here. So, what we're looking at here is our three plan users. So, think of this as your admin panel. We have the AGE public keys showing here, and you can add as many as you want per user, per machine. And they really don't work differently between users and machines. You can see Alex, he's in the group admin that we've created. He has an Alex framework AGE key. He has AGE keys for these three mini PCs and a couple personal computers. You can see that this one is directly assigned through the Alex user. And then we have three that are assigned through the admin group. It's all inherited. Same thing for me. And then for Dima, he just has his one personal computer. We just added him to the plan, so he doesn't have admin access just yet. You can see our machines, and these are their public AGE keys. And you can also see the groups that they're in. I'm sharing certificates between these machines. I share the actual SOP secrets between them. You can see our admins, and you can see that both me and Alex are admins. And we have the mini PCs keys assigned through the group and not the user. Let's check back to see if anything is being done here. We have a couple working. Let's see if we can get our third one working as well. This is all building from a binary cache in Harmonia. I think it's the same thing that they're using here at NixVegas. Just to try to make this go a little bit smoother without great internet. The client secrets, which are defining the actual admin users and the actual machines. You have bars. There's a lot of them. These are all your variables that you want to inject in your machines. Let's go to Britain Framework, which is this laptop I'm on now. I have a lot. Kind of hard to parse, so let's filter that out a little bit. You can see here, secrets. They're all SOPs encrypted. You know how that works. The cool thing is, you can share these secrets, like I said. But if you need to add a new machine or add a new user to this, what Clang does is automatically re-encrypt it, if you have access to it. And that's all based on the auge key. It re-encrypts it as your auge key. Nothing really different than what SOPs and SOPs does. It just makes it a lot easier to actually manage. And then you have nice things like values. So if we go to here , which is where Clang is putting in that variable for my Harmonia public signing key. This is world-readable. It's not encrypted. It's not secret. Anyone can see it. It's great. Because you want to pull in these values. Another thing with VARs is, all these are not... You don't have to input them. You don't have to generate them beforehand. Clang handles that for you with something called generators. So, for example, this Harmonia key is generated here whenever I first either say, Alright, Clang, let's generate all the variables for this machine. Or all the variables for this machine. Or, when you install it for the first time, you update it. Clang will go in, run all this script, generate the values, the keys, the secrets that you want, and put them in that variable folder. Encrypted with the proper auge keys. Cool. Looks like this is going to be back up. Maybe not. Ah, it did not boot back into my OS. Let's catch this one, and we'll roll with it. Yeah, it was trying to pixie boot back into the installer. And it still is. Alright, maybe that will fix that. And I can show you what this is doing. Alright. So you have a lot of secrets. You have a lot of machines. You have a lot of users. You have a lot of users in your roster. How does Clang make that a little bit easier to manage? You have a concept of tags. It's exactly what you think. So, let's run the tags command. Ah, let me get to a different window. And here you can see all the machines and the tags that we have assigned to them. So, our little mini PCs. They have my Telnet service. They have Prometheus added. And then they have some logs. And then this other tag called NV. And so typically whenever you want to go and update a Clang machine, you have to go in, clang-m-update, say, gmk1. I don't think this is up yet, so I don't think it's going to work, but we'll see. But, it's just a NixOS rebuild. And it copies over the config over ssh after a spell. Nothing fancy. What's cool is you can actually define tags that you want to update. So, what this will do is go in and update every single machine with this NV tag. Again, I don't know if this is going to work, but we'll see. Okay, yeah, we're building. Potentially. While we wait, let's go back to tags. So we just have a few tags on those mini PCs. What about my actual laptop? The Sprint and Framework. We have a ton. So let's go and look at what that actually has inside. So let's go to... How about laptop? So here we have a bunch of Home Manager profiles that we've made. This just passed through and basically makes Home Manager modules a planned service. So you can just add them. You don't have to do anything crazy. You can just copy and paste them over. Cool. So, we have all the MyTerminal, HyperLan, whatever. It's all defined here. If we go into my actual machine's config, you can see it's pretty minimal. I'm not actually defining any of those values in here. It's all being added to it, after the fact, through the clan tag. And to show you one of the mini PCs, we have absolutely nothing. The only thing in here is we have a Disco-generated template using the NixOS factor that pulled this device ID right here and just the template information that we want to use XTF for. So we have tags for machines, and we also have tags for users. And you can see some of that if we go back to roster. So, for example, let's go to britainr on britain-fw. You can see I'm running phish. I have my base tag, my dev tag, and my laptop tag. And that's where it's pulling in the values for Alacrity, HyperLan, etc. That's where all that's defined. So we go and look at the file that we actually put that in. We're just adding tags here. And so, there's a little more here because this is the machine tags and the actual... well, it's all the machine tags and a lot of services that don't exist right now. And this is done through the clan inventory. So, it's basically just like where you go and grab what services you want for whatever machine you want. And you can be pretty particular with this. Let's go to Harmonia. You can see here, this is what clan calls instances. And you can have multiple instances of the same service. So , you can define Harmonia as many times as you want. And they're completely separated. You add tags to this here. And going forward, it will pick up the role you defined in the clan service. So, if we were to look at that. You can see we have a server role. We have a client role. This is where we're actually defining the actual configuration. We have the base defaults in that Harmonia slash default. And then we're actually specifying what we want in that for your specific config. And you can share these clan service modules with other people. You can pull them in from Git or other Flakes, etc. So, in this example, I'm just running Harmonia on my localhost. So, we go over. We have our cache. But what's cool about this, we also have clients. And you can see that it uses the client role. And we're specifying my... Ah, this is outdated. I only have it on this computer. You can add this role to multiple hosts. You can modify all those mini-PCs just by going and adding this tag here. So, this onyx cache. And that literally just looks like this. So, after I save this, I run a clan mupdate to update these mini-PCs. And all of them will have my cache automatically added. I don't have to go in and add it to every machine. I just add the tag. And I'm going to check this one more time to see if anything is working with those mini-PCs. I think so. So, one of the things I have set up is, like I said, the monitoring stack. Prometheus, Loki, Grafana. All that's being pulled in. I also have a PromTel service running. So, everything on my telnet automatically gets pulled into Prometheus. And let's see if... So, we have my framework. We have my desktop at home. And I think we have one of the mini-PCs was up. So, there you go. We'll look at my desktop at home. Works the same way. It's also defined in the clan inventory system as a machine. But this just lets you pick and choose what services and how you want them for every machine you want. And it's basically a top-down approach of Nix and NixOS for an organization. Instead of putting up each machine, caring about every single thing that's on it. Like , alright, I'm going to build a custom installer or whatever. This just allows you to just kind of treat your computers like cattle. Like in the DevOps model. Like, I have reflashed these three mini-PCs probably about 25 times, 30 times in the past two days trying to get everything working correctly. Yeah, it is similar to Ansible. It also replaces things like Colima, Deploy RS. It just brings everything in one framework. But we've been running this, me, Alex, Dima. We've been running this for about two months, three months probably. And it is so much better. I was trying to make this kind of myself beforehand. And a pretty shitty version of it is what happened. Found Clang. Moved over to it. Mainly because of ours, which is trying to be out-trained into NixOS. One last thing. We also have roles and roster. So these are roles you want to define at the system level. This is not Clang-specific. So, for example, let's go to Dima. I added him as just a basic user on all three of these mini PCs. And then he's a full owner of his Zenith machine. Which basically means he has full access. He can go and update it. And these are actually changing the user profile on each machine. So, for Dima, you see his Zenith machine. He's the owner. And, again, these are where he's defining, like, this is my laptop. I want my Zalige config. I want my NeoGem config on this. And just add or remove tags as needed. And then on, like, these mini PCs, I literally just gave him a user account. He can log in. It's just pulling in his public key here. And that's all. So, like, you can just add as many users. You can add as many machines as you want. And it's very simple. Makes everything, like, all together in this Clang inventory system. One thing about Clang, I will... there's a few caveats. It's not stable yet. There's many, many breaking changes. Trying to stabilize it for next time, next month. I suggest probably waiting until then to check it out. But in the meantime, if you want to see, like, a working-ish version of it, and this is the actual repo we use. I'll leave it up here for a second. Onyx computer slash onyx-core. See if it will actually load. You can look through this repo, kind of see how things are laid out. And maybe see if you want to give Clang a chance. Thanks, everyone. Questions? Freed? I feel like if it's a personal use case, you don't have multiple users, and it's just you trying to manage multiple machines, probably at that 3 or 4 level is when I would consider switching over. If you have multiple people using a single machine or multiple machines, honestly, two machines. It makes things dead simple. I have considered it. It is part of Disco. It is a template. I've been too scared to test it before doing this talk. Say that again? It's all managed through Git. There is some state management, but for the most part, I would say no. That's more on you. Similar to a Terraform model where you have your local state, or you can use S3, whatever. You just have to be careful about where you're updating your machines from. I haven't had much of an issue. Right now, we've just been using it like a local Git. With CICD, you would probably just want to completely rebuild through a GitHub action or whatever. It would just be a new user in the clan, or a new clan user with permissions to whatever machines you want to redeploy. Anything else? Cool. Thanks, everyone.