Skip to content
IT related

Flakes

Updated 1 min read Linked from 1 page

Using Flakes

The first step in using the flakes fetaure is to enable them in the config file found at /etc/nixos/configuration.nix. I have attached a basic version.

You must enable the experimental feature with this line nix.settings.experimental-features = ["nix-command" "flakes"];
and then you must run sudo nixos-revbuild switch to implement that change.

Make a new folder to hold your first test flakes setup in your home directory. Then copy the files attached here into that directory. Edit this configuration file, adding the packages you would like in the same way you would a normal Nixos config file. Run this command to begin building and using the flake.
sudo nixos-rebuild switch --flake .

Some resources i want to keep track of.

  1. The beginer NixOs/NixOs flake book; https://github.com/ryan4yin/nixos-and-flakes-book
  2. Another good explanation over 3 blog posts of NixOs; https://www.tweag.io/blog/2020-05-25-flakes/
  3. Here is a beginner tutorial https://serokell.io/blog/practical-nix-flakes
  4. Maintaining NixOs with flakes in production https://github.com/Gabriella439/nixos-in-production/blob/main/manuscript/Setup.md

Attachments

  • configuration.nix
  • flake.lock
  • flake.nix
  • hardware-configuration.nix
IT related RSS feed Published with Oblish

Keyboard shortcuts

/
Search
[
Previous page
]
Next page
?
Show this list
Esc
Close