This page is an overview of the Nix built-in functions, and functions available in Nixpkgs' `lib`.
## Built-in functions (`builtins`)
Built-ins are core language functions built directly into the Nix language evaluator. These functions are available through the global `builtins` constant.
* [Nixpkgs lib reference by teu5us](https://teu5us.github.io/nix-lib.html#nix-builtin-functions)
## Assertion functions (`lib.asserts`)
Assertions are generally used to check and/or enforce certain requirements in your configuration files. They're often used to handle conflicts between features or dependencies.
Generators can create various file formats from Nix data structures. They all use a similar interface: `generator { config-attrs } data`. `config-attrs` are used to overwrite the generator's default attributes.
Modules functions let you define, evaluate, and merge Nix modules. They also include functions to import module definitions from other formats, like JSON and TOML.
Two of the most commonly used functions in this set are:
*`mkIf`, which lets you adds conditional statements to your modules, and
*`mkMerge`, which lets you combine multiple module definitions into one.
Source filtering functions change how sources are copied to the Nix store. For example, if you want to add a Git repository to your Nix store, but don't want to include the `.git` folder, you can use `lib.sources.cleanSource ./folder`.
Sources:
* [Nixpkgs lib reference by teu5us](https://teu5us.github.io/nix-lib.html#source-filtering-functions)
- Getting the current version/release of Nix (`lib.trivial.version`, `lib.trivial.release`)
- This also includes functions to compare the current version/release against a specific version/release, in order to conditionally enable features (`lib.trivial.oldestSupportedRelease`, `lib.trivial.isInOldestRelease`)
- Error and exception-handling functions (`lib.trivial.warn`, `lib.trivial.throwIf`, etc.)
Resources:
* [Nixpkgs lib reference by teu5us](https://teu5us.github.io/nix-lib.html#miscellaneous-functions)
Versions functions are for parsing version numbers from a string. This works well in tandem with `lib.trivial.version`, which retrieves the current Nixpkgs version.
Resources:
* [Nixpkgs lib reference by teu5us](https://teu5us.github.io/nix-lib.html#versions-functions)