Skip to content


Snowfall Lib automatically passes your merged library to all other parts of your flake. This means that you can access your own library with or any library from your flake inputs with The namespace for your library and packages can be configured with snowfall.namespace.

To create a library, add a new directory to your lib directory or use the base lib directory.

Terminal window
# Create a directory in the `lib` directory for library methods that will be merged.
mkdir -p ./lib/my-lib

Now create the Nix file for the lib at lib/my-lib/default.nix (or lib/default.nix).

# This is the merged library containing your namespaced library as well as all libraries from
# your flake's inputs.
# Your flake inputs are also available.
# Additionally, Snowfall Lib's own inputs are passed. You probably don't need to use this!
# This will be available as ``.
my-helper-function = x: x;
my-scope = {
# This will be available as ``.
my-scoped-helper-function = x: x;

This library will be made available on your flakeā€™s lib output.