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
attrset
and returns anattrset
. - It may declare
options
. - It may define
option
values. - When evaluated, it produces a configuration based on the declarations and definitions.
{lib, ...}: { options = { name = lib.mkOption { type = lib.types.str; }; }; }