1
0
mirror of https://git.oat.zone/dark-firepit/dotfiles synced 2024-11-23 02:12:26 +01:00
git.oat.zone--dark-firepit-.../lib
System administrator affdf52f23 refactoring
2022-04-20 09:53:28 +01:00
..
colors.nix Dotfiles 2022-01-11 17:44:40 +00:00
default.nix Dotfiles 2022-01-11 17:44:40 +00:00
modules.nix refactoring 2022-04-20 09:53:28 +01:00
nixos.nix Dotfiles 2022-01-11 17:44:40 +00:00
pkgs.nix Dotfiles 2022-01-11 17:44:40 +00:00
README.md Dotfiles 2022-01-11 17:44:40 +00:00
utils.nix Dotfiles 2022-01-11 17:44:40 +00:00

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