1
0
Fork 0
mirror of https://git.oat.zone/dark-firepit/dotfiles synced 2024-05-12 17:16:07 +02:00
git.oat.zone--dark-firepit-.../lib/README.md
System administrator ec00c09f2e Dotfiles
2022-01-11 17:44:40 +00:00

21 lines
879 B
Markdown

# Lib
The `default.nix` defines a lib extended with a `_` attribute under which mine
custom lib functions live. The `default.nix` loads every `.nix` file in the
`libs` (current) directory and imports it.
The importing is quite simple:
1. First the `libsInFolder` reads the contents of the `libs` directory, filters
out non `.nix` files and the `default.nix` file and then returns a list of
paths to the individual `.nix` files it found.
2. This list gets passed to `importLibs` which imports the libraries and
merges the individual imported attribute sets together, so that all the
functions are available directly under one attribute set.
3. This attribute then gets bind to the `_` attribute in the `lib` extension.
Individual `.nix` files can use the functions defined in other local library
files normally using the `nix._.someFunctionName`.
## Overview
TODO