docs: update docs/nix/lib-reference

This commit is contained in:
Florian Warzecha 2024-06-29 14:32:34 +00:00 committed by Auxolotl Wiki
parent 2101380c6a
commit 0c9314f0ea

View file

@ -2,7 +2,7 @@
title: Nix built-in and lib functions title: Nix built-in and lib functions
description: An overview of the various functions available in Nix and Nixpkgs lib. description: An overview of the various functions available in Nix and Nixpkgs lib.
published: true published: true
date: 2024-06-09T16:32:39.315Z date: 2024-06-29T14:32:32.688Z
tags: nix, nixpkgs tags: nix, nixpkgs
editor: markdown editor: markdown
dateCreated: 2024-06-09T16:32:18.232Z dateCreated: 2024-06-09T16:32:18.232Z
@ -56,6 +56,15 @@ Debug functions are useful for debugging Nix expressions.
Resources: Resources:
* [Nixpkgs source](https://github.com/NixOS/nixpkgs/blob/master/lib/debug.nix) * [Nixpkgs source](https://github.com/NixOS/nixpkgs/blob/master/lib/debug.nix)
## Local Files (`lib.fileset`)
A safer and more convenient interface for working with local files (compared to nix's built-in functionality).
Resources:
* [Nixpkgs source](https://github.com/NixOS/nixpkgs/tree/master/lib/fileset)
* [Nixpkgs manual](https://nixos.org/manual/nixpkgs/stable/#sec-functions-library-fileset)
* [nix.dev Tutorial](https://nix.dev/tutorials/working-with-local-files)
## Generator functions (`lib.generators`) ## Generator functions (`lib.generators`)
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. 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.