start	end	text
4090	5870	Hey, guys.
7950	13030	I have a little bit of a live demo, so there's a lot of things that are probably about to go wrong.
13030	16050	I got this maybe working, like, five minutes ago.
16670	18190	My name is Britton Robich.
18250	22710	I've been in Nix, doing Nix stuff, for about two or three years now.
22730	24710	Some with work, some for personal.
24890	26490	Some mix both.
26490	34990	But one of the issues I've always had is deploying multiple machines, and especially among multiple users.
35310	40230	And at PlantNix, I found a... it's called a framework.
40230	45930	I like to think of it as, like, NixOS for teams on Rails, almost.
45930	47890	It's called clan.lol.
48150	58130	And it's basically a framework that combines a few community packages, like Disco, NixOS Anywhere, and SoxNix.
58130	62110	It makes it easy to deploy lots of services, however you want.
62110	65110	Very modular on many machines.
65630	67210	So with me,
70500	83580	if you can see this, this is a little Mac, like, micro rack with three little mini... three mini PCs.
88970	91950	They're all networked together.
92310	94230	I have my laptop on it.
94230	109030	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.
109090	124730	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.
125510	130030	And then I'll show you some more of the, like, clan-specific stuff as well.
130370	133710	So let's get started and move
136800	139380	into all these.
156050	163930	So this is just loading up the netboot image that I've made and hosted on my laptop right now.
177350	182840	So I'm not going to keep switching back between the three mini PCs.
182840	185480	We're just going to focus on this one for now.
185920	189340	But we're just putting it into a normal NixOS installer.
189360	201800	The only main difference is it's using the netboot boot module and then something called NixOS Factor, which is a community project.
201800	206080	Same guys that make SocksNix and Plan.
206080	207900	I think it was made for Plan.
208140	213100	It's basically an alternative to HardwareConfiguration.nix.
213860	225440	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
238980	244860	a deployment like this, you preferably would know all the disks beforehand.
245180	253400	And so we can generate templates using the disk information that we can get from those machines before we actually install NixOS.
253400	254420	How do we do that?
254420	256640	Typically, you just KXAC into it.
257280	273840	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.
273840	282240	The main thing for Plan that you would need to know is this disk ID here.
283100	295960	What that's doing is whenever we are first installing Plan on a machine, you want to create the disk using Disco.
295980	298580	And they have nice little templates.
301870	310020	And you can see here, there's just some variables that get replaced by the actual disk ID from NixOS Factor.
317270	322630	All right, so we're in our netboot image.
322630	325190	Let's actually get NixOS installed on these.
327820	330280	I'm going to run a command.
333600	336660	It's just a built-in Plan CLI.
346550	354910	Installing the three machines with our specific Plan configuration.
354910	356810	We'll get into that briefly.
357290	362250	Let me just get this started to hopefully not having issues.
362250	363610	Cool, cool, cool.
368060	369760	Yeah, live demos.
408100	409820	All right, let's see if this will work.
410180	411540	If not, we're skipping it.
411540	412860	We're just going to explain Plan.
424620	426600	All right, we're going to come back to it.
429950	431830	So, Plan.
431850	432710	There's a few different
439640	446880	components that
453050	456970	make up Plan.
456970	458470	It's kind of their secret sauce.
458950	462850	You have the bars, which is variables, which is very nice.
462850	468710	It's where you can share secrets, values, between any of your Plan machines.
468710	473810	You can actually add a lot of ACL rules to that.
473810	483310	So, by machine secrets, by user secrets, or you can even share them between whatever combination that you want.
484310	506350	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.
506350	514470	You can see here, we have SSHKey, and then TailScaleHothKey.
516330	526990	These are both secret variables, and both of these are shared between just my user, so the BritnR user.
527110	530630	On this, we also have a few other users.
530630	535390	We have Alex and Dima.
536430	547710	And looking again, you can see my BritnR user on the machine is the owner here.
552220	554180	Sorry, let me step back.
561240	564640	Plan has users, and you also have your system users.
564640	575660	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.
576780	582920	So, what we're looking at here is our three plan users.
583220	586680	So, think of this as your admin panel.
586680	595460	We have the AGE public keys showing here, and you can add as many as you want per user, per machine.
595980	599660	And they really don't work differently between users and machines.
600400	604520	You can see Alex, he's in the group admin that we've created.
605160	608780	He has an Alex framework AGE key.
608780	612600	He has AGE keys for these three mini PCs and a couple personal computers.
613480	619540	You can see that this one is directly assigned through the Alex user.
619820	623460	And then we have three that are assigned through the admin group.
623460	624580	It's all inherited.
625960	627360	Same thing for me.
627940	632060	And then for Dima, he just has his one personal computer.
632060	636420	We just added him to the plan, so he doesn't have admin access just yet.
637500	641260	You can see our machines, and these are their public AGE keys.
641980	645220	And you can also see the groups that they're in.
645220	649440	I'm sharing certificates between these machines.
651860	655840	I share the actual SOP secrets between them.
657240	664080	You can see our admins, and you can see that both me and Alex are admins.
664080	673360	And we have the mini PCs keys assigned through the group and not the user.
677010	681770	Let's check back to see if anything is being done here.
681830	684990	We have a couple working.
685950	689670	Let's see if we can get our third one working as well.
693400	697820	This is all building from a binary cache in Harmonia.
697820	701640	I think it's the same thing that they're using here at NixVegas.
702820	707320	Just to try to make this go a little bit smoother without great internet.
723130	728970	The client secrets, which are defining the actual admin users and the actual machines.
729990	731270	You have bars.
731270	732630	There's a lot of them.
732630	735390	These are all your variables that you want to inject in your machines.
736450	742050	Let's go to Britain Framework, which is this laptop I'm on now.
742430	743310	I have a lot.
744410	750370	Kind of hard to parse, so let's filter that out a little bit.
753110	755850	You can see here, secrets.
756050	757310	They're all SOPs encrypted.
757310	758330	You know how that works.
759170	763010	The cool thing is, you can share these secrets, like I said.
763190	771090	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.
771090	772830	And that's all based on the auge key.
773010	775590	It re-encrypts it as your auge key.
776490	779790	Nothing really different than what SOPs and SOPs does.
779790	782790	It just makes it a lot easier to actually manage.
784790	788350	And then you have nice things like values.
788350	792210	So if we go to here
801350	806890	, which is where Clang is putting in that variable for my Harmonia public signing key.
807030	808450	This is world-readable.
808450	809630	It's not encrypted.
809630	810610	It's not secret.
810690	812290	Anyone can see it.
812290	812930	It's great.
812930	814730	Because you want to pull in these values.
815530	821730	Another thing with VARs is, all these are not...
822490	823870	You don't have to input them.
823870	826110	You don't have to generate them beforehand.
826230	829270	Clang handles that for you with something called generators.
830310	835510	So, for example, this Harmonia key is
840050	857140	generated here whenever I first either say, Alright, Clang, let's generate all the variables for this machine.
857140	859500	Or all the variables for this machine.
860060	863340	Or, when you install it for the first time, you update it.
863560	874400	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.
874920	877840	Encrypted with the proper auge keys.
878100	878720	Cool.
881750	886230	Looks like this is going to be back up.
892950	894130	Maybe not.
907000	914480	Ah, it did not boot back into my OS.
914480	916840	Let's catch this one, and we'll roll with it.
922090	925290	Yeah, it was trying to pixie boot back into the installer.
929610	930910	And it still is.
948740	950740	Alright, maybe that will fix that.
950740	952980	And I can show you what this is doing.
955920	956640	Alright.
957340	958640	So you have a lot of secrets.
958660	959580	You have a lot of machines.
959580	960680	You have a lot of users.
960860	962660	You have a lot of users in your roster.
963520	966600	How does Clang make that a little bit easier to manage?
966700	967960	You have a concept of tags.
967960	969200	It's exactly what you think.
969420	972200	So, let's run the tags command.
973940	976960	Ah, let me get to a different window.
979640	983540	And here you can see all the machines and the tags that we have assigned to them.
984180	987080	So, our little mini PCs.
987560	989780	They have my Telnet service.
990340	992340	They have Prometheus added.
992480	994360	And then they have some logs.
994360	996680	And then this other tag called NV.
997360	1007720	And so typically whenever you want to go and update a Clang machine, you have to go in, clang-m-update, say, gmk1.
1007720	1010700	I don't think this is up yet, so I don't think it's going to work, but we'll see.
1013260	1015800	But, it's just a NixOS rebuild.
1017080	1022360	And it copies over the config over ssh after a spell.
1023160	1024360	Nothing fancy.
1025100	1034740	What's cool is you can actually define tags that you want to update.
1034740	1041180	So, what this will do is go in and update every single machine with this NV tag.
1042500	1046480	Again, I don't know if this is going to work, but we'll see.
1047120	1049620	Okay, yeah, we're building.
1050740	1051900	Potentially.
1059720	1062300	While we wait, let's go back to tags.
1065900	1068380	So we just have a few tags on those mini PCs.
1068380	1070320	What about my actual laptop?
1070320	1071680	The Sprint and Framework.
1071960	1073160	We have a ton.
1073180	1077320	So let's go and look at what that actually has inside.
1082070	1085230	So let's go to...
1085230	1086910	How about laptop?
1094770	1100530	So here we have a bunch of Home Manager profiles that we've made.
1100770	1106990	This just passed through and basically makes Home Manager modules a planned service.
1106990	1107970	So you can just add them.
1107970	1109870	You don't have to do anything crazy.
1109870	1111310	You can just copy and paste them over.
1111390	1111990	Cool.
1111990	1118670	So, we have all the MyTerminal, HyperLan, whatever.
1118670	1120070	It's all defined here.
1120070	1123910	If we go into my actual machine's config,
1127020	1129060	you can see it's pretty minimal.
1129060	1132280	I'm not actually defining any of those values in here.
1132280	1136720	It's all being added to it, after the fact, through the clan tag.
1139990	1147350	And to show you one of the mini PCs, we have absolutely nothing.
1147350	1166890	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.
1184570	1189030	So we have tags for machines, and we also have tags for users.
1189030	1193570	And you can see some of that if we go back to roster.
1194450	1200670	So, for example, let's go to britainr on britain-fw.
1200670	1203830	You can see I'm running phish.
1204430	1209050	I have my base tag, my dev tag, and my laptop tag.
1209050	1213410	And that's where it's pulling in the values for Alacrity, HyperLan, etc.
1213570	1215350	That's where all that's defined.
1217110	1220850	So we go and look at the file that we actually put that in.
1223450	1225210	We're just adding tags here.
1227090	1233970	And so, there's a little more here because this is the machine tags and the actual...
1235150	1239470	well, it's all the machine tags and a lot of services that don't exist right now.
1241790	1244550	And this is done through the clan inventory.
1244550	1252770	So, it's basically just like where you go and grab what services you want for whatever machine you want.
1252770	1255850	And you can be pretty particular with this.
1261030	1268080	Let's go to Harmonia.
1269820	1275720	You can see here, this is what clan calls instances.
1276660	1279520	And you can have multiple instances of the same service.
1279520	1283560	So , you can define Harmonia as many times as you want.
1283780	1285460	And they're completely separated.
1285940	1288580	You add tags to this here.
1289400	1295060	And going forward, it will pick up the role you defined in the clan service.
1295060	1296860	So, if we were to look at that.
1302800	1305020	You can see we have a server role.
1308080	1309620	We have a client role.
1311000	1315960	This is where we're actually defining the actual configuration.
1315960	1319980	We have the base defaults in that Harmonia slash default.
1320440	1325000	And then we're actually specifying what we want in that for your specific config.
1325120	1328780	And you can share these clan service modules with other people.
1328780	1332600	You can pull them in from Git or other Flakes, etc.
1333880	1339120	So, in this example, I'm just running Harmonia on my localhost.
1339120	1341660	So, we go over.
1347580	1348880	We have our cache.
1351280	1354460	But what's cool about this, we also have clients.
1354720	1358840	And you can see that it uses the client role.
1359620	1362600	And we're specifying my...
1362600	1364020	Ah, this is outdated.
1364840	1366300	I only have it on this computer.
1366980	1370360	You can add this role to multiple hosts.
1370360	1375480	You can modify all those mini-PCs just by going and adding this tag here.
1375480	1377120	So, this onyx cache.
1379960	1382820	And that literally just looks like this.
1392550	1398550	So, after I save this, I run a clan mupdate to update these mini-PCs.
1398830	1404110	And all of them will have my cache automatically added.
1404110	1407070	I don't have to go in and add it to every machine.
1407070	1408330	I just add the tag.
1416200	1422160	And I'm going to check this one more time to see if anything is working with those mini-PCs.
1422160	1423120	I think so.
1423860	1428700	So, one of the things I have set up is, like I said, the monitoring stack.
1428700	1430500	Prometheus, Loki, Grafana.
1431300	1432780	All that's being pulled in.
1432780	1436100	I also have a PromTel service running.
1436100	1440480	So, everything on my telnet automatically gets pulled into Prometheus.
1441820	1444660	And let's see if...
1445940	1448760	So, we have my framework.
1450100	1453760	We have my desktop at home.
1453920	1457680	And I think we have one of the mini-PCs was up.
1457760	1459500	So, there you go.
1459940	1461380	We'll look at my desktop at home.
1461380	1462340	Works the same way.
1462340	1467220	It's also defined in the clan inventory system as a machine.
1470240	1478720	But this just lets you pick and choose what services and how you want them for every machine you want.
1478960	1485520	And it's basically a top-down approach of Nix and NixOS for an organization.
1485520	1490720	Instead of putting up each machine, caring about every single thing that's on it.
1490720	1494260	Like , alright, I'm going to build a custom installer or whatever.
1494260	1499080	This just allows you to just kind of treat your computers like cattle.
1499080	1501340	Like in the DevOps model.
1502040	1511220	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.
1522380	1524520	Yeah, it is similar to Ansible.
1524520	1529800	It also replaces things like Colima, Deploy RS.
1529800	1532140	It just brings everything in one framework.
1534660	1537500	But we've been running this, me, Alex, Dima.
1537500	1542400	We've been running this for about two months, three months probably.
1543900	1546400	And it is so much better.
1546600	1549380	I was trying to make this kind of myself beforehand.
1549480	1552880	And a pretty shitty version of it is what happened.
1552880	1553900	Found Clang.
1554140	1555240	Moved over to it.
1555240	1559400	Mainly because of ours, which is trying to be out-trained into NixOS.
1568490	1569870	One last thing.
1570270	1572170	We also have roles and roster.
1573090	1579610	So these are roles you want to define at the system level.
1579610	1581730	This is not Clang-specific.
1582530	1587530	So, for example, let's go to Dima.
1587530	1593590	I added him as just a basic user on all three of these mini PCs.
1593730	1596530	And then he's a full owner of his Zenith machine.
1596590	1598490	Which basically means he has full access.
1598490	1600230	He can go and update it.
1600670	1605290	And these are actually changing the user profile on each machine.
1605290	1608190	So, for Dima,
1613300	1615800	you see his Zenith machine.
1615880	1616860	He's the owner.
1617140	1620920	And, again, these are where he's defining, like, this is my laptop.
1620920	1623100	I want my Zalige config.
1623100	1627020	I want my NeoGem config on this.
1627380	1629760	And just add or remove tags as needed.
1631140	1635460	And then on, like, these mini PCs, I literally just gave him a user account.
1635460	1636420	He can log in.
1636540	1640660	It's just pulling in his public key here.
1641220	1641960	And that's all.
1641960	1645160	So, like, you can just add as many users.
1645160	1646940	You can add as many machines as you want.
1646940	1648680	And it's very simple.
1648680	1653740	Makes everything, like, all together in this Clang inventory system.
1657120	1661460	One thing about Clang, I will... there's a few caveats.
1661620	1663000	It's not stable yet.
1663580	1665980	There's many, many breaking changes.
1665980	1669320	Trying to stabilize it for next time, next month.
1669720	1672820	I suggest probably waiting until then to check it out.
1672820	1682240	But in the meantime, if you want to see, like, a working-ish version of it, and this is the actual repo we use.
1690380	1691880	I'll leave it up here for a second.
1694960	1697840	Onyx computer slash onyx-core.
1697980	1699440	See if it will actually load.
1701060	1703800	You can look through this repo, kind of see how things are laid out.
1703800	1708960	And maybe see if you want to give Clang a chance.
1709680	1711160	Thanks, everyone.
1716470	1717670	Questions?
1718250	1719450	Freed?
1731830	1746610	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.
1746610	1755330	If you have multiple people using a single machine or multiple machines, honestly, two machines.
1755330	1757290	It makes things dead simple.
1766720	1768080	I have considered it.
1768080	1769700	It is part of Disco.
1769700	1771100	It is a template.
1771180	1775440	I've been too scared to test it before doing this talk.
1778930	1780330	Say that again?
1782150	1784330	It's all managed through Git.
1794860	1799340	There is some state management, but for the most part, I would say no.
1799340	1801140	That's more on you.
1801980	1808680	Similar to a Terraform model where you have your local state, or you can use S3, whatever.
1808720	1814820	You just have to be careful about where you're updating your machines from.
1815360	1817040	I haven't had much of an issue.
1817620	1821420	Right now, we've just been using it like a local Git.
1822420	1829820	With CICD, you would probably just want to completely rebuild through a GitHub action or whatever.
1830780	1839380	It would just be a new user in the clan, or a new clan user with permissions to whatever machines you want to redeploy.
1845090	1846410	Anything else?
1847470	1848470	Cool.
1848470	1849490	Thanks, everyone.
