NixOS Modules
A module is a file containing a Nix expression with a specific structure. It declares options for other modules to define (give a value). It processes them and defines options declared in other modules.
Basics
- A module is a function that takes an
attrsetand returns anattrset. - It may declare
options. - It may define
optionvalues. - When evaluated, it produces a configuration based on the declarations and definitions.
{lib, ...}: {
options = {
name = lib.mkOption {
type = lib.types.str;
};
};
}