Video chapters
-
0:00 Enabling Nix Flakes
Transcript
Enabling Nix Flakes
0:00 so now let's get from theory to practice and first enable flakes of course you can skip this video right now if you already know that you enabled flakes for example if you use the Determinate Nix installer you have flakes already enabled if not then it's just a one-minute process so at first you will open your personal Nix configuration or the global Nix configuration depending on if you want to enable flakes for you or for everyone and then you just add this line what's interesting here is that we are enabling Nix command and flakes which is two separate features but they have such a huge overlap that you always want to enable them both if you use NixOS then you want to add this snippet to your NixOS configuration somewhere of course you know where your configuration resides I trust that you will find where you want to put that however if you don't use NixOS then just adding this to this file does not need you to it doesn't require you to restart the Nix daemon or anything it will just work right out of the box and in NixOS you will of course have to rebuild your system but afterward it will just work that's it that's all see you next video when we play with flakes
About this lesson
Flakes are still an experimental feature, so a fresh Nix install refuses every nix flake command until you switch them on. This short lesson shows the exact configuration line for plain Nix and the snippet for NixOS. The whole process takes about a minute.
In this video
- The one line for your Nix configuration, and why it enables two features at once, not one
- Where the setting goes on NixOS versus a non-NixOS install, per user or for everyone
- What needs a rebuild and what works immediately without restarting anything
After this lesson
Flakes and the new nix command work on your machine, and you are ready for the hands-on lessons that follow.