WEBVTT

00:00.000 --> 00:00.400
Okay.

00:00.400 --> 00:01.640
Can you guys hear me okay?

00:02.120 --> 00:02.780
All right.

00:02.780 --> 00:03.120
Great.

00:03.120 --> 00:03.740
Thanks.

00:04.980 --> 00:07.920
So this talk is also meant to be, if you want, interactive.

00:07.980 --> 00:10.500
So if you have a question, I'm happy to stop.

00:10.880 --> 00:13.320
It's definitely an introductory talk.

00:13.320 --> 00:15.660
So if something's confusing, put your hands up.

00:15.660 --> 00:20.160
And if I feel like I can't answer it now, I'll be like, let's answer it later.

00:20.400 --> 00:23.620
So welcome to the talk on learning Nix the fun way.

00:24.380 --> 00:26.760
First off, this talk can be found online.

00:26.920 --> 00:28.680
There's the URI.

00:29.580 --> 00:32.680
And this is a reprieve of a talk I gave at Planet Nix.

00:32.680 --> 00:35.920
So if you heard that talk, nothing's really changed.

00:36.300 --> 00:40.060
You know, my goal is to just spread Nix and some of the fun parts of it.

00:40.060 --> 00:44.020
A lot of it can feel overwhelming and academic.

00:45.080 --> 00:48.500
I welcome improvements, edits, and corrections.

00:49.100 --> 00:50.180
And yeah.

00:52.080 --> 00:52.760
Okay.

00:52.760 --> 00:55.560
So just really quick, let me introduce myself.

00:55.560 --> 00:56.340
I'm Fareed.

00:56.340 --> 00:58.100
I currently work at Confluent.

00:58.160 --> 01:00.600
They're like known for Apache Kafka.

01:00.700 --> 01:02.420
That's some software project.

01:02.420 --> 01:03.820
I don't work on that.

01:03.820 --> 01:06.800
I work on build systems and automation and developer productivity.

01:07.060 --> 01:09.820
I've been using Nix in a variety of capacities.

01:10.140 --> 01:15.480
For a while now, I've presented at a bunch of NixCons, North America, and Europe.

01:15.880 --> 01:23.040
And I had the pleasure of bringing Nix into Google through an acquisition at Looker.

01:23.140 --> 01:25.240
I'm very bullish on Nix.

01:25.240 --> 01:28.400
It's been a source of mostly joy.

01:28.400 --> 01:33.020
And I had the fortunate experience of leveraging it to complete a PhD.

01:33.020 --> 01:35.040
So this thing says nearly complete.

01:35.040 --> 01:37.920
I completed my PhD as of June.

01:37.980 --> 01:39.780
So yeah, I'm very happy about that.

01:44.700 --> 01:50.080
Okay, so that was like the alternate working title for this talk.

01:50.080 --> 01:53.200
And I want to share effectively why I love Nix.

01:53.200 --> 01:54.740
Love is a strong word.

01:54.800 --> 02:03.420
But Nix has brought me a lot of joy, simplification of my software life, and ultimately love.

02:03.720 --> 02:08.040
You know, sometimes though, it's felt like learning it can be challenging.

02:08.440 --> 02:12.540
And I find it's really important to find like the purpose of what I'm learning and why.

02:13.720 --> 02:16.840
So ultimately, like why I love Nix, and you should too.

02:20.860 --> 02:23.140
I've given a lot of talks about Nix.

02:23.180 --> 02:29.300
I've given talks to meetup groups, friends, plenty internally at the companies I've been a part of.

02:29.380 --> 02:37.460
And this is kind of a photo of in my mind, when I'm thinking about wanting to talk about Nix, talking to others.

02:37.460 --> 02:48.120
It's like a noble pursuit where I'm imparting knowledge to my apostles about like what they're missing out on, and they're gaining some infinite wisdom.

02:48.120 --> 02:51.740
And it's somewhat academic, the whole thing.

02:53.820 --> 03:00.540
I tend to always begin these talks, covering that, like Nix as an idea started from a PhD thesis.

03:00.660 --> 03:04.540
And for some reason, I can't not mention the PhD thesis.

03:04.540 --> 03:09.860
I think it's like a law when you do a Nix con talk, or Nix talk, sorry, rather.

03:10.780 --> 03:14.480
And the PhD was the purely functional software deployment model.

03:14.540 --> 03:16.780
And it was in 2006.

03:18.000 --> 03:25.560
In retrospect, when you start off with a thesis for a talk, this slide better depicts how the talks have gone.

03:25.560 --> 03:30.920
People in attendance are totally bored by the nuance and complexity of what I'm talking about.

03:33.140 --> 03:45.880
At worst, I've immediately turned off potential Nix, new Nix enthusiasts by immediately jumping in to like an academic and incredibly verbose vocabulary about the ideas and technologies about Nix.

03:45.940 --> 03:48.220
And I've just lost a willing convert.

03:52.020 --> 03:55.180
Okay, so the motivation of this talk is like, I want to do it different.

03:58.520 --> 04:00.540
Let's learn Nix the fun way.

04:00.580 --> 04:03.360
You should be sold why Nix, what's fun about it?

04:03.360 --> 04:04.880
Why do you want to use it?

04:05.320 --> 04:10.100
You know , it's going to be a little bit of a crash course, but you should come away with like, wow, there's some benefits here.

04:10.100 --> 04:11.700
And it's fun to use.

04:11.860 --> 04:17.020
I want to impart the benefits of using Nix by what I believe to be learning Nix the fun way.

04:21.300 --> 04:22.800
Okay, let's begin.

04:22.800 --> 04:26.640
So there's gonna be some code samples, I apologize, can't get around it.

04:26.640 --> 04:27.780
It's a code thing.

04:28.160 --> 04:30.340
Let's begin with something seemingly innocuous.

04:30.340 --> 04:33.460
This is a script to determine the IP of my current machine.

04:33.680 --> 04:35.320
Looks pretty standard.

04:35.360 --> 04:41.060
I'm hoping most of the people here are probably reminiscent of a lot of scripts that might have looked like this or written themselves.

04:41.300 --> 04:43.360
And it stitches a few programs together.

04:43.360 --> 04:50.180
So we have bash, curl, jq is this tool, if you're not familiar with it, it processes JSON, and you can pull things out of it.

04:51.700 --> 04:58.240
So I run it, and I get the IP of my machine that I'm running from, or the gateway or whatever.

05:01.820 --> 05:06.820
Here's what rewriting that same script in the most raw form of Nix would look like.

05:06.820 --> 05:09.680
Oh, God, you're scared, you wouldn't write this.

05:09.840 --> 05:11.900
I know I just showed you a new language.

05:11.900 --> 05:14.160
But just ignore that for a second.

05:14.880 --> 05:20.720
The only takeaway is it looks like okay, if you squint, it's new, it's scary.

05:20.720 --> 05:24.720
But if you're programming, it should look like JSON.

05:24.900 --> 05:29.440
You know, it looks like other languages on the face of it.

05:29.440 --> 05:32.600
So there, it's not like totally out there.

05:34.980 --> 05:37.180
That's the important part of this recipe.

05:37.800 --> 05:41.200
Okay, there's like, it looks to like the script we wrote before.

05:41.200 --> 05:44.340
Okay, so there's like a direct mapping, I'm pretty happy here.

05:48.050 --> 05:50.890
But of course, that's not what you'd actually write in Nix.

05:51.050 --> 05:55.330
The following is a little bit more idiomatic, and a lot more terse.

05:55.730 --> 06:00.190
And right now we're getting a lot closer to the original script we'd written.

06:02.170 --> 06:06.950
So this is how you'd write that first script in Nix.

06:07.170 --> 06:11.070
And I'll show you like why you'd want to do that anyways.

06:11.130 --> 06:20.650
So for those that might want to follow along now or later, it's important to keep note of this commit value and that I'm building this on an AMD 64 Linux machine.

06:26.090 --> 06:32.570
Okay, so Nix, I wrote this like thing that I'm telling you you should do for this script.

06:32.870 --> 06:33.490
Why?

06:33.490 --> 06:35.010
Well, let's see, let's build it.

06:36.070 --> 06:38.510
Okay, you get some output.

06:39.110 --> 06:41.110
It has the name, what is my IP?

06:41.110 --> 06:42.430
Okay, that's cool.

06:43.930 --> 06:49.630
Inside of this path is a script, and it's that script we ended up creating.

06:51.790 --> 06:55.610
We can execute that script, and it works as we expect.

06:55.610 --> 06:57.050
That's the original IP.

06:57.050 --> 06:59.070
We're functionally identical so far.

06:59.070 --> 06:59.990
So far so good.

06:59.990 --> 07:01.830
I didn't lose functionality.

07:02.170 --> 07:03.410
This is great.

07:06.310 --> 07:10.310
Okay, but why did we go through this whole thing?

07:10.310 --> 07:14.150
Why did I make you learn a superset of JSON basically?

07:14.150 --> 07:15.750
Why do we even need Nix?

07:15.770 --> 07:17.070
What's this file?

07:17.070 --> 07:18.090
What does it look like?

07:19.950 --> 07:31.030
Okay, so the output of the script actually looks really similar to what we might have written offhand at first, except everything seems to be prefixed with this really long string.

07:31.870 --> 07:37.650
So you can see like everything has a Nix store or something in front of it, but for the most part everything's identical.

07:40.640 --> 07:46.960
Okay, although I promised not to get too academic into Nix, this part is important.

07:48.300 --> 07:57.980
What is that garbled string at the front, like ahead of our build script, and similarly found within the script before each of the tools?

08:01.340 --> 08:08.240
Well, Nix has a handy command, and it could show us what does that script, like what does that prefix mean?

08:08.260 --> 08:11.460
So you could write Nix derivation show and give it the path.

08:14.980 --> 08:19.860
Okay, so the whole purpose of Nix is to kind of build this file.

08:19.860 --> 08:25.100
Why did we go through all that setup of writing that recipe?

08:25.180 --> 08:30.860
It's ultimately to produce this, and it's the recipe of what it takes to build our IP script.

08:33.080 --> 08:34.900
It has the build command.

08:36.740 --> 08:41.420
It has the text of the script, which may be also the source code.

08:43.280 --> 08:51.880
It has the input tools we needed, so our script needed bash, jq, curl, for some reason this thing called standard end.

08:54.300 --> 09:01.100
It also has the system we're running on, and as well as the architecture and operating system.

09:01.420 --> 09:08.360
So all of this is hashed together to give you that garbled string at the absolute top.

09:10.520 --> 09:30.260
So that's actually a really mind-bending property, because when you see that garbled string, that means we actually have incredibly strong guarantees about our build recipe, because the build recipe includes other garbled strings that represent other garbled strings,

09:30.260 --> 09:35.800
that represent other garbled strings, and so forth and so forth, down to the source code.

09:37.860 --> 09:44.600
There's a level of recursion here that means repeatedly seeing this hash is an incredibly strong property of reproducibility.

09:44.600 --> 10:01.380
You can train your eye, if I see the same string, I have this incredibly strong property about the whole tree of software, whatever the root of what you're building is, is identical down to the architecture, source code, tools, and then recursively at each of those levels.

10:05.240 --> 10:11.400
In Nix, you spend a lot of time wiring things up to basically model things as a graph.

10:11.400 --> 10:18.400
Turns out, once you have a graph, everything you might want to do in software is a permutation or transformation of graphs.

10:18.400 --> 10:19.680
That's all we're doing.

10:20.540 --> 10:29.000
So I built the thing in Nix, I can now have it visualized as this graph, and Nix gives me a handy command to do so.

10:29.000 --> 10:30.540
And here is that graph.

10:31.420 --> 10:36.300
This is the full dependency graph of that seemingly innocuous script.

10:36.300 --> 10:46.920
So in software today, we are taking on so much implicit dependencies we don't know about, and Nix makes those extremely evident and explicit.

10:48.380 --> 10:56.140
So, I don't know, we see jq and for some reason there's krb5 and then that's Kerberos.

10:56.140 --> 11:02.000
I don't know why, you know, to build libcurl, I'm sure, because it has a bunch of dependencies and on and on.

11:05.100 --> 11:07.960
Okay, so here's another Nix snippet.

11:08.060 --> 11:13.100
Again, ignore the actual syntax, but know that we're defining here a shell environment.

11:13.100 --> 11:19.280
So you're working on a project, and you want to define a set of tools to build your project file, to build your project.

11:21.440 --> 11:25.020
And remember that garbled string at the bottom.

11:25.880 --> 11:31.080
We import our same script as I did before and we add it into our shell.

11:31.080 --> 11:34.820
So I'm saying I have a shell and I want to use this tool.

11:35.900 --> 11:37.600
Then you can enter the shell.

11:43.020 --> 11:45.820
Okay, so you can Nix shell and you enter the shell.

11:48.660 --> 11:52.060
I see the little shell hook I did just to show you we're entering a shell.

11:54.900 --> 12:02.760
So I can say my path now contains what is my IP, so I can say which on it.

12:03.780 --> 12:08.580
And it'll find the same path of the binary.

12:08.740 --> 12:15.460
And more importantly, it finds it at the exact same prefix that I had built earlier.

12:15.460 --> 12:21.500
So now I'm taking that exact same binary and moving it into an environment for a developer.

12:21.980 --> 12:32.060
And I know that that developer has the exact same binary and all its dependencies with an extremely strong invariant.

12:33.960 --> 12:39.660
And it's also good it runs and works as we expect, because if it didn't, that would be a big waste of time.

12:42.670 --> 12:43.630
Boom.

12:43.730 --> 12:45.210
To me, this was huge.

12:45.210 --> 12:47.810
I was like, did we realize what we just did?

12:48.630 --> 12:53.970
We just created a simple way to bring reproducible developer environments for projects.

12:53.970 --> 13:05.570
You don't need to give a docker file, have people enter namespaces, network namespaces, volume mounts, you know, doing non-reproducible steps.

13:05.570 --> 13:11.730
This is a way to be natively giving reproducible packages across individual developer projects.

13:13.810 --> 13:16.790
And you could easily validate it thanks to that prefix hash.

13:20.860 --> 13:22.620
But this goes even further.

13:22.620 --> 13:24.860
We actually know everything about our code now.

13:25.940 --> 13:28.320
We can do binary or source deployments.

13:28.320 --> 13:42.960
Again, when we have that graph, we can take that graph and move all the pieces of that graph, which represent files on your machine, onto another machine, and we like to colloquially call that a deployment.

13:45.560 --> 13:48.440
So, Nix makes this really simple.

13:48.720 --> 13:52.280
We simply copy those paths from one machine to another.

13:53.160 --> 13:58.620
And they don't even need Nix installed, because you're just moving it from a folder to a folder.

14:00.160 --> 14:01.100
Boom.

14:01.200 --> 14:02.200
Deployments.

14:02.280 --> 14:07.380
I don't need some crazy fancy machinery or whatever to get perfect reproductive deployments.

14:07.380 --> 14:08.320
Yeah, question.

14:12.150 --> 14:17.050
Yeah, the question was, will this only work if you're on the same architecture and operating system?

14:17.050 --> 14:17.630
That is correct.

14:17.630 --> 14:20.910
Unless you have bin format and you're doing emulation.

14:20.970 --> 14:28.090
But you can build on one machine for the target host, because you can cross-compile relatively easily in Nix.

14:28.490 --> 14:38.590
So, the idea, though, ultimately I want to get across is when you have a graph of things, you just move the graph of things to the machine and you know it's perfectly going to work.

14:38.590 --> 14:44.790
I don't know how many of us have ever been like, I built something here locally and I installed it there.

14:44.790 --> 14:51.470
Oh wait, it doesn't have libssl or it has libssl at 1.0 and not 1.1.

14:51.610 --> 15:01.210
You've captured everything down to libc, like the fundamental library in Linux, and you move that over and you know everything's going to work perfectly.

15:05.880 --> 15:07.360
So, here's one such command.

15:07.360 --> 15:11.440
There's a couple ways to do it in Nix to copy the graph we saw earlier to another machine.

15:11.440 --> 15:17.100
In this example, we're leveraging Nix copy, but you could do something as dumb as scp or rsync.

15:17.480 --> 15:20.800
I didn't mean to call you dumb if that's what you use, I just meant simpler.

15:22.840 --> 15:27.560
So, the items are copied over and let's log into this machine.

15:31.040 --> 15:38.380
And I ran the path and notice it's the exact same path that is present there and I run it.

15:38.380 --> 15:40.260
So, it's that same prefix string.

15:40.660 --> 15:49.960
So, that means for it to have run, because it points to other very specific paths, all those paths were there on that other machine and it all works and wires and runs.

15:49.960 --> 15:53.020
So, I moved that whole graph over.

15:55.910 --> 16:06.930
Wow, we just did a deployment of not only our code, which was the script, but all of its necessary dependencies, such as curl, jq, and bash.

16:07.570 --> 16:09.290
This blows my mind.

16:09.450 --> 16:19.370
Like I said, I can't tell you the number of times in practice I had to coordinate the runtime needed on the host for some base library not being present or whatever.

16:20.290 --> 16:22.490
It simplifies it a lot.

16:25.140 --> 16:30.480
Okay, well maybe that's a bit aggressive for deployments and you've already drank the Kool-Aid of Kubernetes.

16:33.180 --> 16:43.340
No problem, since we know the graph and again everything is merely a transformation of a graph, we can turn that into an image.

16:47.100 --> 16:53.740
So, here's another snippet, and again ignore the syntax, but know this is creating an OCI-compliant image.

16:58.410 --> 17:02.390
We set the commands of our image to be our whatismyip package.

17:05.580 --> 17:10.940
And just like that... next slide... so let's go build that image.

17:13.580 --> 17:18.300
So, the output of it is a tarball, because an OCI image is a tarball.

17:20.500 --> 17:29.340
We can load that tarball into docker daemon as normal, or you could do this through whatever the you know a registry or whatnot.

17:31.460 --> 17:37.120
Okay, I could run the tarball, or run the image effectively, and it works as we'd expect.

17:37.120 --> 17:41.100
I get the IP, because the the command was the IP.

17:41.100 --> 17:52.540
I can inspect the image, and we yet again see that the same prefix hash on our package for the command to execute is there.

17:52.540 --> 18:00.820
Again, this continues to give me those warm fuzzy feelings in the inside that I've now produced an image that I'm deploying, and it has the same prefix hash.

18:06.390 --> 18:07.470
Cool.

18:07.650 --> 18:10.770
So, we have Nix and docker integration perfectly.

18:10.830 --> 18:14.550
The image produced only has the files exactly necessary to run the tool.

18:14.690 --> 18:18.450
So, I've also done effectively distroless, which is all the rage right right now.

18:18.450 --> 18:21.910
So, you don't have any other base libraries running around.

18:21.910 --> 18:30.630
You've built an image and a file system exactly with what's needed to run the command and or the application therein.

18:32.590 --> 18:34.390
And honestly, you could do the same.

18:34.390 --> 18:35.930
There's plenty of other slides here.

18:35.930 --> 18:39.090
I'm not going to show you every variant, but everything's just a permutation.

18:39.090 --> 18:40.730
We did OCI images.

18:40.910 --> 18:43.930
You could do a random assembly tarball.

18:43.990 --> 18:45.710
You could do a self-extracting zip.

18:45.710 --> 18:46.670
You could do RPM.

18:46.670 --> 18:47.610
You could do a Debian.

18:47.610 --> 18:48.610
You could do a flatback.

18:48.610 --> 18:50.110
You could do an app image.

18:50.270 --> 18:54.250
Again, you've spent all the time setting up your graph.

18:57.130 --> 19:01.130
Well, Linux distribution itself is actually just a collection of packages.

19:01.250 --> 19:05.750
It's a permutation and a collection of software files.

19:05.750 --> 19:16.820
It turns out, you could also build an OS out of Nix itself, and that's what NixOS is.

19:18.780 --> 19:25.380
Again, oh, so again, ignore the... this is like a very basic config setup for a NixOS image.

19:25.440 --> 19:32.700
You don't have to care about the syntax, but what's important is we're setting one up, and I'm importing that same package.

19:33.300 --> 19:38.740
And I'm telling the OS image, include this as a default package within the image.

19:40.840 --> 19:44.480
And I'm starting it as a VM, just so I could demo it.

19:45.280 --> 19:49.240
But you can build an ISO or whatever and then boot into it.

19:52.350 --> 19:55.230
Okay, so like everything else, we build it.

19:55.230 --> 19:56.930
So I'm building my VM.

19:57.570 --> 20:01.590
Again, keeping in mind, we want to look for this prefix hash.

20:02.890 --> 20:06.010
So we get an output directory.

20:07.290 --> 20:11.430
Okay, and within that output directory is a run script to run KMU.

20:11.430 --> 20:17.830
I'm going to run my OS with some fun parameters, just so I can see stuff in the TTY.

20:21.100 --> 20:23.300
It starts to log in into NixOS.

20:23.400 --> 20:24.680
I log in.

20:26.760 --> 20:31.860
And again, I execute which is which, what is my IP.

20:31.860 --> 20:33.420
Looks like I found it.

20:33.420 --> 20:37.180
It's on some other symlinks path, but then I say real path.

20:37.180 --> 20:42.500
I get to the underlying symlink, and I see that warm, fuzzy feeling again.

20:42.500 --> 20:44.320
I see that same prefix hash.

20:44.320 --> 20:55.920
So now I've built an OS distribution that has my software package, perfectly reproducible with all its dependencies and that same OS.

20:56.000 --> 20:57.360
I feel happy inside.

20:57.360 --> 20:58.360
I feel joy.

20:59.460 --> 21:04.240
And yeah, and it works, because we ran it.

21:05.280 --> 21:06.280
Oh, that was it.

21:06.280 --> 21:07.300
Yeah, thank you.

21:12.190 --> 21:12.790
Questions?

21:12.790 --> 21:14.270
Yeah, and I'll try to repeat them.

21:23.600 --> 21:27.740
I think the question was, can you do a NixOS module?

21:33.290 --> 21:40.210
Yeah, I mean, the question is, can you do a NixOS module to configure a Docker image?

21:40.830 --> 21:42.350
Sure, I think you could.

21:42.350 --> 21:46.430
A module is just another level of abstraction to set up code.

21:46.430 --> 22:03.430
And I could see, if you have a very consistent pattern for building your OCI images, you might not want them to have to write something closer to a Docker file and write some other higher level thing that you end up emitting the OCI tarball for.

22:03.430 --> 22:04.290
Totally.

22:12.530 --> 22:15.410
Okay, the question is, where is jq and curl coming from?

22:15.410 --> 22:16.630
That's a good question.

22:16.690 --> 22:21.050
So it would be incredibly tedious to have to rewrite the world yourself.

22:21.270 --> 22:24.210
Thankfully, there's a large community that has already done that for you.

22:24.390 --> 22:27.350
And that is called Nix Packages.

22:27.350 --> 22:35.770
So there is already a huge package set where authors have already taken the painstaking time to do all those dependency edges.

22:35.770 --> 22:37.930
So you don't have to always start from scratch.

22:40.710 --> 22:47.290
And it's also the world's largest package set, by at least one order of magnitude, I think.

22:55.710 --> 22:58.950
Yeah, the question is, there's Nix Package Manager and NixOS.

22:59.690 --> 23:01.950
Naming in Nix is hard.

23:02.290 --> 23:03.750
They don't do a very good job.

23:03.750 --> 23:11.930
I think my takeaway for the talk is Nix just says, tell me what your graph is.

23:12.030 --> 23:14.850
And once I have your graph, I can do whatever I want with it.

23:14.850 --> 23:18.490
So there's Nix Package Manager that says, download the graph.

23:18.670 --> 23:23.890
Something like, you know, apt-get or yum or whatever.

23:23.890 --> 23:29.150
So it says, you have a name, download the graph for me and let me install this package locally.

23:29.510 --> 23:37.150
NixOS says, here's a bunch of packages, turn them into an OS distribution, and let me run that.

23:37.150 --> 23:44.370
So they're all just different variants of, here are different graphs, put them together and make them a thing.

23:51.760 --> 23:53.440
Yeah, what is Nix Shell?

23:53.860 --> 24:04.060
So Nix Shell, just to get a bit more pedantic, will download the packages, but it puts them in this separate Nix store thing .

24:04.360 --> 24:06.300
And then it just sets your path.

24:06.400 --> 24:11.160
So in Linux, how things are found is they do a search along your path.

24:11.320 --> 24:23.900
So the moment you do a Nix Shell, it drops you into a new bash environment with your path set with some new... your path environment variable set with some new directories.

24:23.900 --> 24:25.020
So they're found.

24:25.040 --> 24:29.560
So it's like, ephemeral to that single session.

24:29.560 --> 24:34.820
And what's great is there's no container, no namespaces, no cgroups, nothing.

24:34.820 --> 24:38.620
So you're like fully native within the host.

24:51.290 --> 24:54.510
Sorry, the question is, does this work for alternate architectures?

24:56.390 --> 24:57.650
Things work.

24:58.290 --> 25:00.970
Ultimately, you're building third-party software.

25:01.110 --> 25:09.250
So the asterisk here is, do things work for alternate architectures, is going to be, does that software build anyways reliably for those alternate architectures?

25:10.190 --> 25:11.770
If you're on your own.

25:11.770 --> 25:24.850
The other benefit is, if using this large package set, authors have taken the time, and many of them are here, they're running RISC-V or cross-compiling, and they've submitted patches to make them work for alternate architectures.

25:24.850 --> 25:28.170
But fundamentally, Nix is architecture agnostic.

26:00.300 --> 26:14.700
Because Nix is this recursive hash calculation, a cryptographic hash of your stuff, if I changed even a comment in my source code, I went back to that script, what is my IP, and I put a comment.

26:14.700 --> 26:17.960
I functionally didn't change the thing.

26:19.820 --> 26:30.920
Asterisk will get a different hash, because when it goes to build this big recipe file, so this is the recipe file that says, Nix, this is how you build this thing.

26:31.540 --> 26:41.700
It had here the text, that's the contents of the script, like the contents of the script to change, and then therefore the hash changed.

26:41.940 --> 26:43.380
Again, this is recursive.

26:43.380 --> 26:56.260
That meant if I wanted to use a different curl, and it only changed because of a comment, its hash would change, and now my hash would change, because I have a different hash in my hash.

26:57.640 --> 27:02.440
So I get a totally different output, and that's okay, they live side by side.

27:03.000 --> 27:09.460
The beauty of having hashes in the name is now they're not colliding spaces in the directory.

27:09.460 --> 27:12.800
They're just like sitting side by side in a big directory tree.

27:13.620 --> 27:16.780
If I want to go back, I delete that comment.

27:16.860 --> 27:23.280
If I perfectly delete it, and the hash calculates back to the same thing, Nix says, you already got it there, buddy.

27:23.280 --> 27:26.400
I'm not going to do it again, and it skips some work.

27:29.910 --> 27:32.890
Again, really clear, that's not bit reproducible.

27:33.290 --> 27:35.010
Nix can do bit reproduction.

27:35.390 --> 27:36.530
This is a bit different.

27:36.530 --> 27:47.290
This is pessimistic reproduction, because the source changes always affect the hash.

27:51.590 --> 27:52.510
Okay, thank you.

27:52.510 --> 27:53.390
I'll be around.

27:53.390 --> 27:56.190
If you have more introductory questions, I'm happy to answer.

27:56.270 --> 28:01.370
If you have high-level questions, I'm happy to answer, and I hope you learn to love Nix as much as I do.

28:01.370 --> 28:02.110
Thank you.

