Declaration - NixOS Wiki
NixOS module has declarations to provide an interface for other modules. Option declarations are used to make NixOS aware of configuration possibilities or to hide the complexity of configuration. Option declarations are used to provide an interface over the inherent complexity of configuring the system. See also the manual. Options are declared with the mkOption function which is provided by the Nix package collection library (pkgs.lib attribute set). An option declaration may contain the following attributes: An option can be declared in multiple modules, with one condition which is that no attribute collisions exists between the declarations except for the options attribute. The evaluation is done with the following piece of code where opt is the option declaration. You can find this piece of code inside lib/modules.nix. The apply function is replaced by the identity function and the merge function is replaced by the mergeDefaultOption function if they are not defined. Types are use