Skip to main content

What is Nix flakes

Author: oomfie

🏷️ NixOS Bite-size

What is Nix flakes?

Nix flakes is an experimental feature of the Nix package manager [1]

Nix flakes manages your inputs and outputs and your arg and modules.

it can be used in many ways for example:

1 - Managing your Whole configuration.

2 - Making custom iso's.

3 - Making nix packages.

To enable Nix flakes temporarily (NixOS):

nix-shell -p nixFLakes

or enable Nix flake permanently in NixOS add these lines in your configuration.nix file (NixOS):

nix.settings.experimental-features = ["nix-command" "flakes" ];

or via home-manager (For other non-NixOS distros):

nix = {
 package = pkgs.nix;
 settings.experimenal-features = ["nix-command" "flakes"];
 };

or via editing the $XDG_CONFIG_DIR/nix/nix.config or /etc/nix/nix.conf:

experimental-features = nix-command flakes

It's recommended to use Git with Nix flakes to easier maintenance.

Now you know your way with Nix flake <3.