1.3 Installing Nix the right way: multi-user, flakes, and what to avoid
Lesson 3 of 68 · 11:12
Video chapters
-
0:00 Introduction to Nix installation
-
0:48 Choosing the recommended install method
-
2:30 Running the installer and creating build users
-
5:00 Verifying Nix and enabling Flakes
-
7:48 Using nix shell and understanding the Nix store
Transcript
Introduction to Nix installation
0:00 Welcome to the Nix installation section, so here we're gonna learn how to install Nix, how to, like what not to do, little do's and don'ts here and there and after this video your Nix will be installed and configured to use Flakes and then we can continue with the rest. So, let's go. Actually we would go to the nixos.org homepage.
0:30 You just go to nixos.org and say download and then we can run the commands that are listed here. Ah, it's important. The first impulse would be that you just run sudo apt install nix or sudo pacman, whatever. I suggest to not do that.
Choosing the recommended install method
0:49 The Debian Ubuntu and Arch Linux packages are community tested, so they will work, but the community doesn't have the capacity to test like all the versions of all the distros and everything. So what you will get when you install this command here, that will be the first class experience that works among all the distros and so on, so I would stick to that. One aspect that I want to highlight is that they are talking about the multi-user installation and the single user installation here.
The full transcript comes with the lesson.
About this lesson
There are several ways to install Nix. The most obvious ones (your distro's package manager, Docker) work, but they quietly give you a worse experience for months. This lesson takes you from a clean Linux or macOS machine to a working Nix installation with flakes enabled. Everything later in the course builds on this setup.
In this video
- Why you should not install Nix with apt or run it in Docker, even though both work
- Single-user or multi-user installation: which one to pick, and what actually lands on your system
- What those 32
nixbldusers are for, and why they make every build safe - The one config line that turns on flakes and the modern
nixcommands, no daemon restart needed - Your first
nix shellmoment: run a package, exit, and it's gone. Where did it go? That question drives the next videos.
After this lesson
You have a correctly set up Nix with flakes enabled, and a first mental picture of the daemon and the sandboxes you just installed.
Links: