Nixos Modules by Marcos Benevides
:ID: 01b79396-e6d4-4673-9438-95a120543f05
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;
};
};
}