NixOS configuration is a flake output type which describes a NixOS operating system for a specific system.
NixOS modules is a different flake output type which is useful for organizing and reusing NixOS settings. NixOS configurations can import NixOS modules, but cannot import other NixOS configurations. It is therefore recommended to generally use NixOS modules, and use NixOS configurations to declare a specific system configuration, while relying on imports of NixOS modules, see Imports.
If you wish to build e.g. a cloud server image or embedded server image, check out NixOS generate output.
On the flake create screen, enter an appropriate name, then click "create".
You should now see the name of your flake in the flake selector to the upper right on your screen.
A flake is a software configuration unit specific to the language Nix. Each flake has a set of inputs and outputs. Your NixOS configuration will describe an output in your flake. Note that your flake can have many outputs of different types at the same time. The inputs of your flake are locked to exact versions when you release your flake, which makes your configuration reproducible.
nixosas the name and
x86_64-linuxas the system.
Your NixOS configuration should now be shown as an output in the flake output screen.
As part of our configuration, we will add the following settings to the NixOS configuration:
truefor the key
nixosfor the key
slpackage to the configuration.
sltool available as a system package in our configuration.
Never configure sensitive passwords in plaintext.
Instead, use the users.users.<name>.hashedPassword option with a hash of a password with sufficient entropy.
nixos-rebuild build-vm --flake <latest-flake-url>#nixoswith the URL and
Congratulations! You are now running a NixOS operating system defined as a flake.
To celebrate, run the