Aquaris standard library for use in modules.
Functions:
merge
: recursiveUpdate folded over a list of valuessubsF
: Generalized text substitution function. Takes the following parameters as a set:file
(path): Path to the original file that should be readsubs
(set of strings): Substitutions that should be applied to the file’s contentfunc
: Function that takes the filename and the substituted text and should output the result ofsubsF
. Example:pkgs.writeScript
subsT
: A specialized version ofsubsF
that just returns the text.readLines
: Reads a file and returns the list of lines with\n
strippedimportDir'
: A function to import Nix files in a directory. Takes two parameters:- a set containing:
default
(boolean): shoulddefault.nix
be included? Default: falsedirs
(boolean): should directories be included? Default: true
- the directory to import
- a set containing:
importDir
: Identical toimportDir' {}
aka.: takes a directory, imports all files (exceptdefault.nix
) and subdirectories.adt
: Converts NixOS submodules into Algebraic Data Types (Wikipedia). Takes a set of submodules, functions to submodules or files containing the previous items. Returns a set of:is.foo
: Functions that checks if a given set is an instance of thefoo
submodulemk.foo
: Function that converts a given set into an instance of thefoo
submoduletype
: Type value suitable forlib.mkOption
The
is
andmk
subsets include items for all passed submodules (foo
is just an example)ADT instances are submodules with the added option
_tag
, set to the name of the instance. This means a submodulefoo
passed toadt
would be given a default_tag = "foo";
value.This is used by Aquaris’s filesystem module (the actual type is passed here).