text stringlengths 0 2.02k |
|---|
• Nix uses reproducible builds with hashes to ensure packages are built consistently and securely |
• Nix is compared to other package managers like apt and Homebrew, with Nix offering more guarantees due to its reproducible build process |
• Nix can be used to create isolated installs, similar to universal binaries, and can be used alongside other DevOps tools like Docker |
• Nix is complementary to Docker, providing a way to build and configure packages, while Docker provides runtime isolation |
• Nix can be used to build Docker images, providing a way to ensure reproducibility in the build process |
• Docker images and Nix package management |
• Customizing Nix packages for size optimization |
• Remote builds and deployments with Nix |
• Cost savings and caching benefits of remote deployments |
• Nix ecosystem growth and bleeding-edge features |
• Content-addressable store optimization |
• Command line redesign for usability |
• Community growth and infrastructure development |
• The Haskell community is the fastest growing area in the Nix ecosystem. |
• Nix is gaining traction in the Rust and other programming language communities. |
• DevOps teams are adopting Nix for its reproducibility and assurance features. |
• Nix requires a different mindset, turning operational tasks into development tasks. |
• Domen Kožar recommends starting with NixOS manuals and Nix.dev for tutorials. |
• Additional resources include Nix Pills, Nix Shorts on YouTube, and NixOS.org. |
**Jerod Santo:** Domen, you're here to tell us all about Nix. Welcome to The Changelog. |
**Domen Kožar:** Thank you. |
**Jerod Santo:** We are excited to have you... I heard a lot about Nix; I hear a lot of smart people saying the word Nix... And I also hear them saying UNIX. Not the same thing... But Nix is a lot of things, from my research... Can you tell us what it is, in your words? |
**Domen Kožar:** Sure. The way I see it, it's an ecosystem of tools that you can use to develop, build and deploy software. In other words, I'd say it's a kind of Swiss Army knife of DevOps. Particularly, Nix is two things, or maybe even three, so that's what makes it a bit confusing... It's the language, the package m... |
**Jerod Santo:** Okay. So where did Nix come from? Who created it, and why did it come into the world? |
**Domen Kožar:** Yeah, so I think it's almost 20 years now since Eelco Dolstra started research in Utrecht, if I'm correct, in the university there. He eventually had his Ph.D. thesis be about Nix... And also developed the first prototype and the first version of it. So that's where it started; it was essentially spons... |
**Jerod Santo:** So it was a research project sponsored by grants... |
**Domen Kožar:** Exactly. |
**Jerod Santo:** And what was the purpose? What was its intended-- |
**Domen Kožar:** \[04:11\] The purpose was - again, this is according to me talking to Eelco many years ago - to see if functional programming paradigms can be applied to solve packaging problems. |
I think that the university there has a pretty big department on functional programming research, and this was one of the areas that they tried to apply to it. |
**Jerod Santo:** So what was your introduction to Nix then? It came much later, I suppose, than that 2001, if it was about 20 years ago... |
**Domen Kožar:** Yeah, it was around then, yeah. |
**Jerod Santo:** It became a research project... When did you find it and what got you excited? |
**Domen Kožar:** That's an excellent question, yeah. I was doing a lot of Python development in 2012, I believe it was... And particularly, I was working in the community called Plone. It's a CMS, pretty old now, and not that well known as it was before... But we had a lot of packages there. I think it was about 300 pa... |
**Jerod Santo:** And what did you find? Was there an a-ha moment, or was there a feature, or a thing that it did that you appreciated? Because you're big into Nix at this point. You're doing the Nix.dev website, you've got the weekly newsletter... You came to us and said "Hey, let's talk about Nix", so this is somethin... |
**Domen Kožar:** I think my first a-ha moment was -- you know, I was back then doing consulting, and we had a client in Finland. I used to use Gentoo. In Gentoo, when you rebuild everything, you have to recompile (it's called) the world. And at that client I needed to upgrade in order to have the newest package, and I ... |
Then I switched to Ubuntu at the time, and I really didn't like the inflexibility of it. So when I went into Nix, I was like "Oh, this is the best of two worlds. I can have this source distribution, and binary distribution model at the same time." |
So when I tried Nix after Florian introduced it to me, and I saw that you can roll back, and there is a binary cache for all the packages from open search, that you just download everything instead of compiling, but you can apply a patch and it switches to the source model, I was like "Oh, this is what I need", so I ca... |
On top of that, the design - you know, one of the biggest features advertised is the rollback. So the way Nix does -- it uses a symlink to switch between the previous and the current version, which is an atomic operation on Linux... So essentially, you can always roll back to the previous version of a system that you'v... |
**Adam Stacoviak:** If you're on Linux, is this in some cases a replacement or an augmentation of apt-get, or apt, or is this sort of like a whole separate thing where it's purely for building and delivering software? How do those two worlds play together, between like an apt, or an apt-get, or something like that? Are... |
**Domen Kožar:** \[08:11\] Yeah, they're completely different. Nix replaces the whole stack... It exposes a so-called imperative package management model, which is what you are familiar with apt-get; so we can, say, install a package, or uninstall a package, and so on. But behind the scenes it works very differently. T... |
What allows this flexibility of rollbacks is that these packages are completely installed in separate folders. In make you have prefix, where you can say where it will install something, and this is the nix store, slash, and then that hash. It's called a global store, where you have all the packages then. |
**Jerod Santo:** Right. I think some of the confusion with Nix is because -- and I like the way you describe it as an ecosystem, is because there are different aspects to this. So there's NixOS, there's Nix Packages, there's Nix which appears to be a language, there's a Nix language that you use in order to configure t... |
Maybe explain the ecosystem and the different bits, because when I read about NixOS, I think "Is this a Linux distribution, or is this a package manager?" And kind of where Adam is like "Can I use it with Debian and replace apt-get, or do I need to be using NixOS?" So help us understand the ecosystem better. |
**Domen Kožar:** Usually, the answer to this question is "Yes, everything." \[laughter\] |
**Jerod Santo:** Okay, okay. Ultimate flexibility. |
**Domen Kožar:** Yeah. So at the very core, it's a bunch of design concepts and a language. The language allows you to write something to this Nix store and create a folder or a file, and so on. But then there are building blocks on top. So we have, as we said, the language, the package manager, which officially is sup... |
Then there's the OS, which is a Linux distribution built on top of the package manager. So you can deploy -- it's for desktop and server, so you can have... For example, I run NixOS on my desktop and my servers. You have GNOME and KDE as two desktop environments, and there's a few others as well. And the servers - it's... |
And then there's different smaller parts of the ecosystem, like Home Manager, which allows you to manage home files, dotfiles. That's a separate project, but still, it's done by Nix. And yeah, people do all kinds of crazy stuff with the Nix API to build and deploy software, so it can be applied to any of these things. |
**Jerod Santo:** \[12:18\] It's kind of nice, because it's approachable in that way. If you're already just running macOS, or maybe running Ubuntu as your development environment and you want to use Nix package manager, and have your own little isolated Nix environment, you can do that, so you don't have to go all-in. ... |
**Domen Kožar:** Yeah, exactly. I think the easiest way to get started is to use the nix-shell, which allows you to -- it's kind of like virtualenv, but system level, or Ruby environment, or all these language-specific tools. And you can expose then a shell environment for your project with a bunch of tooling, which i... |
And yeah, the other one is to be able to install a bunch of software that otherwise the Linux distribution doesn't expose it, or something else... Those are the two common paths. |
**Jerod Santo:** So at the core of Nix is this package management system, which is purely functional, as it says on the tin. So in addition to that, you have Nix packages, and this, I assume, is similar to what we'd expect with an apt-get, or with a Homebrew, where you have a package ecosystem of packages that you can ... |
**Domen Kožar:** Okay. So this is called the Nix Packages part of the ecosystem, which I've kind of left out... But yeah, it's on GitHub, so it's kind of easy to contribute. You just open a pull request. Now, we're not there yet, but we should hit 100,000 pull requests pretty soon. That's probably one of the biggest pr... |
Now, to be fair, Debian and others are pretty strict what goes in and what doesn't, and Nix Packages is just kind of like an ever-growing one... But I would say almost any package you wanted to install is in the Nix Packages collection. |
And everything that is free is also built from source, and there is a binary for it, unless it's broken, or some other -- but yeah, by default we build all the packages on a part of the ecosystem called Hydra, which is kind of like a CI system, also built for Nix. It's the build farm, which has macOS, Linux, and also A... |
**Adam Stacoviak:** \[16:00\] It seems like the core tenet of it really is about reproducible builds. It seems like that's the core feature that everything sort of hangs upon. Even in the documentation, when it talks about Nix, it says -- you know, a lot of what you've already said here, but it says "This means that it... |
**Domen Kožar:** Yeah, that's correct. I think there is a lot of benefits, and one of the jobs that we haven't been doing that great as a community is really enumerating all of them... Because one side of it is this page of reproducible builds, because of the purely functional model... But I don't like to explain it th... |
So yeah, you've enumerated a few, and there's a bunch of others... So on Nix.dev I've come up with a list that is incomplete... But yeah, rollbacks are the number one feature. |
One of the cool things is that you can build your whole system remotely, on a different machine than yours, and then just copy everything to a different system, and just say activate, and in a matter of seconds you have the new system running there. So the build and deploy or activate phase are completely separate, whi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.