Those two are two half boxes, because the other half is in, you know, the vanadaire.
But I guarantee those are two boxes.
So one for the networking and one for the computing.
I bought it years ago on eBay.
I think some startups ran out of business and they had like many full-sized rack, full
of nukes and, you know, NVIDIA boards.
So I bought one and I started to play with it.
So now I have ten nukes lying around at home, five GPU and I don't know what to do with
them.
So this is how everything started.
So I have a single point of failure and all the SREs and DevOps here, you know, will hate
it, but it's my single point of failure and I love it.
And I call it Snowflake because it's unique.
And what it does, it does a very minimal setup.
It's the only long-living server or nukes, if I can call it server.
I would call it server.
So it's my only long-living server I have.
And it runs a DHCP server.
It runs Pixiboot, a TCP server, and is the core of my home lab.
It runs there and it distributes the, you know, the NixOS derivation that I want to
net boot on the other servers when I hook them to the network.
As you know, because you are here and you are like me, I tend to automate everything
I can.
So as I said, this is the code that I wrote in the NixOS derivation for the Snowflake
server.
I start OpenSSH, I configure my keys, I didn't, you know, paste that, the public key there
because it was too long and not great, but you know how to do it.
And I start PixiCore and I configure it with a package called Blackhole that is the distribution
I use for net booting.
And I'm going to, you know, get to net booting later on.
I have my.files shared with the NixOS configuration, so you can check that if you want.
So what is, my Snowflake server is used to do Pixi booting and net booting, to distribute
the images I want on my Fimmer Labs.
And PixiCore is a tool that helps with that.
It can be used, Sandalone is a Go project that you run, it exposes a DHTP server, an
HTTP server to download the, you know, the kernel and the initram disk.
And then this is Blackhole, so Blackhole is the, when you do net booting, you need an
operating system to run on the new servers.
And I generate that from a NixOS derivation.
It's also very lightweight because it stays in RAM, so it's not persistent on disk, so
it needs to be as small as it can be.
So I use the net boot base profile and I change to minimal, but I didn't update my slides.
So if the image is too big, you can use the installer minimal, that is a bit smaller.
And then I install OpenSSH because this is what I use to enter into the server when it
boots.
But what is net booting?
So from zero to zero in one minute, because that's how good I am with Nix booting, with
net booting.
And so every server or many computers boots and they look for, you know, an operating
system on disk, and if there is not an operating system on disk, they look for a USB one.
And if there is not a USB, the world becomes way bigger and they try to send a DHCP request
to the DHCP server, says, oh, I'm alive, what can I do?
And if you have a smart enough DHCP server, it replies with a package containing the IP
address for the server and then an address that can be used to download an in-it RAM
disk and a kernel and boot the server.
So this is, you know, very old style, but still in use.
You know, all the cloud providers that I had the opportunity to work with use this because
hardware doesn't change that quickly.
So Pixi booting is still there and this is the same things I use.
So I download all the two binaries and the two packages and my server is ready to boot.
So for me, I take the, you know, the compute models out from my boxes, I hook it to the
network and they power on the DHCP kernel and I'm ready to SSH.
This is kind of the log you get from PixiCore when it detects like a new server ready to
handle an installation process.
So, you know, the IP is assigned 162 and it downloads the kernel, the in-it RAM disk that
I generated with the black hole scripts that you just, Nixx derivation that you just see
and it boots.
So on the end of the booting process, you have an address that you can SSH into and
you have a server to play with.
Obviously, this is not persisted.
So when you reboot the server, the dance would start again and again forever and you would
get a fresh new server to use.
But for my ephemeral homelab, this is what I need.
I just need a quick way to prototype.
So if you can get enough RAM to be happy, and for me, 8 GB of RAM is happier than ever,
I can play with that.
Obviously, all the nooks can have, you know, disk attached to it and you can decide to
persist the operating system on it.
So you can write a system disk script that does Nixx install at the end of the, when
the server is booted and you don't need to touch anything, when the black hole starts,
it would run the scripts, the system D scripts and it would have a new persisted and flashed
operating system.
As I said, I don't do that because I don't need it, but that's how the full cycle, life
cycle of the machine can be managed.
And how do you, if you persist a disk, how do you reboot the server and get back to the
pixie, to the pixie dance is all on you.
In my case, I don't have, like the nooks doesn't really have a board, a BMC to control the
server, so I can't force the boot loader to net boot.
So I wipe the disk and they break the disk, so it will go to net booting.
A bit rough, but you know, homelabs, that's how it is.
So service discovery, in my case, it's way simpler than what it should be.
You can use console core DNS or whatever you want, Type-K even, so you can, you know,
in black hole, you can register a Type-K daemon and have it registered there, and you see
that in the UI, I use my router.
So when I see that there are new servers with a NixOS hostname, I know that there is a server
ready to be, to used and that it's booted.
In the meantime, when it does the pixie dancing, the hostname is pixie and a random MAC address.
So it kind of gives me enough control and I don't need to run anything else, but you
can get fans here if you want.
So what is net booting used for?
Only for ephemeral homelabs, as I said, no, cloud providers or, you know, people managing
data centers that I think you know more than me, but you can do that for inventory management.
So when you buy a shiny new server, it doesn't do much, it doesn't know what to do, so you
just hook it to the network and the pixie dance starts and instead of running a script
that persists an operating system, you run a daemon that registers the server to an inventory
management like Netbox or others.
So you can, you know how many, how much RAM it is, the model, whatever you can get from
the system, you expect the system, you push the blob and you register a brand new servers
and you have it available in your system.
So it's kind of the same process I do for mine, but way cooler because the hardware
is way more expensive.
You can do that for provisioning, so as I told you before, I don't do provisioning because
I don't want a persistent operating system on my homelab, but you can format and partition
disks using system if you want or any other way to run a script and you're ready to go.
For recovery, the same way, as I said, I don't have a BMC, but you can, you know, break your
disk and get back on pixie booting.
Some of the hardware have disks attached, but I don't really use disk much and even
if you, because I don't need it, so my operating system is small enough and I do simple stuff
that don't require me to, you know, swap or go on the disk, so I can use the entire disk,
I can format it just for the data if I need to store some data.
In order to do orchestration, pixie core, you can declare MAC addresses and the images
you want to push to.
So if you know the MAC address of your Ethernet cable, you can say, oh, on this MAC address,
distribute this image, otherwise distribute a different image, so you can have servers
running different net booting images and it's very convenient.
So now when it comes to electric wiring, I'm also not really an expert, so what I have,
I have a really, you know, a powerful, a powerful enough DC that is connected to a few fuses
so I don't, you know, blow up all the nodes at the same time, one at a time maybe, but
not all together, so that's why I have the fuse there, easy, cheap, it works.
And then to control, you know, the power consumption, I just cut the power at the beginning, so
I have a Raspberry Pi connected to a board of 16 relays that I control over an API, so
if I want to stop the nuke number one, I just, you know, stop, cut the energy and the power
for that nuke, and goodbye nuke, and, you know, playing with the GPIO, the Raspberry Pi is
very easy and convenient, so for the prototype, it's good enough.
I want to change from a Raspberry Pi from ESP32 to experiment a little bit, but it's
not really for NixOS, because it doesn't run an operating system, so, just there, and
I got two new fancy boxes that I want to replace with the IKEA one, because I think that would
play a better role with my, you know, ambient there, and I don't know if I'm late or earlier,
but that's it.
Okay, so, yeah, this is my home lab and what I'm playing with, so if you have any question
or if you want to know more, I will just go back to the, if I can, my invite is to have
a look at the.file repo, if I can, oh, I can go there, at the.file, because it has
all the code in there and you can play with it, so coming back to these slides, what I
really like is the convenience of, you know, I have my NixOS derivation, for these experiments
I'm building two NixOS derivations and the flake, there's no flake one encapsulates the
other one, so I can distribute it conveniently and it's a single flake file that contains
and run both, so it's, you know, it's very easy and it's very easy when you get to it.
To get there, it took me 135 questions on this course, 36,000 messages on metrics, but
I'm there as it's there for you, so play with it if you want, so thank you.
Yeah, because it's very, oh yeah, how NixOS plays with the pixie booting and, you know,
net booting, you have, I didn't find, there are other packages or other projects that
helps you to package an operating system, like HashiCore Packer is another one, there
is Infrakit from Docker and all those kinds of stuff, so, but NixOS gives you full control
on the distribution that you want to provide, so for example at the beginning I wasn't really
looking at the size of the image, so I was pushing in there everything I needed, but
then I started to realize that my image was like four gigabytes and my RAM, I didn't have
enough RAM or I didn't have enough RAM left to do the actual work, so I started to iterate
and play on what I was able to remove, so I started to investigate about how to do a
minimal operating system, so I see that minimal profiles, I disabled the documentation, I
disabled, you know, everything that I don't need it, and I went back to like a, now the
image is 400 megabytes in RAM when it's fully unpacked and it works, so it's good enough,
so I think that's really the power you get from NixOS compared with other systems.
For getting questions answered, I can also suggest the Discord server which is also pretty
great.
Okay, yeah, I will look at it.
Thank you.
One more round of applause please.
Thank you.
Okay, I'll produce some more.
One more round of applause please.
Thank you.
We ready for the next?
Great.
Yes.
Hi.
I'm Philip.
I'm here on behalf of Circle, a company, so we specialize on, you know, software delivery,
customized to the clients, you know, like what people want.
This talk is about NixOS, so like, you know, I'm here in Boston 2023, of course, and my
talk is pitfalls of NixOS and how to avoid them, right?
So at Circle, we use NixOS for like infrastructure, we use NixOS for CI CD and setting up deaf
environments.
Basically, everywhere you can use NixOS, we try to adopt it just because, you know, NixOS
is great.
You have audio visibility and everything that comes with that.
Right.
So this is me.
All my socials are here.
If you want to reach out to me, my GitHub.
Right.
Yes.
So Circle, as I said, is, you know, a software company focused on creating customized high-performance
solutions.
Yes, I can.
Right.
Sorry.
So this is mainly in like the like functional programming realm of like Haskell and like
stuff like that, where, you know, people want customized solutions for certain problems.
Exactly.
Right.
So again, this hurts about Nix.
And this is, right.
The goal of this talk is to make Nix more approachable.
Right.
So when we adopted Nix, I mean, I wasn't dead then.
Obviously, developers weren't using Nix, right.
And they still, you know, they try to, right.
So there has to developers, they're not dead into Nix, right.
And they had some issues and I want to touch on that just so that, you know, a case study
of how Nix works in Circle.
Exactly.
Right.
Sorry.
I'm right.
So I am pretty new at Circle and I'm part of the SID team.
So I try to push Nix too.
In the often times you have developers.