Jump to
↵select↑↓navigateescclose

Reference

Reference

The flake outputs, library functions and option references of frappe-nix, with links to the scaffolder, the scripts and the repository layout.

Updated
Tags
  • reference
  • flake
  • outputs
  • library
On this page

This section lists what frappe-nix exposes. For guides, start from the overview.

Flake outputs

The frappe-nix flake itself provides:

OutputPurpose
flakeModules.defaultThe flake-parts module. Import it and configure perSystem.frappe-nix.
nixosModules.defaultThe standalone NixOS module that exposes services.frappe-nix, for multi-tenant production with systemd.
lib.mkFlakeA flake-parts.lib.mkFlake wrapper that merges frappe-nix's inputs into the consumer's.
lib.overridesComposable Python package overrides for native dependencies.
packages.<system>.default, frappe-initThe scaffolder, run by nix run github:Avunu/frappe-nix.
packages.<system>.backup-fetchThe object-store half of bench restore, standalone, for a production host that restores too. It prints a JSON manifest and touches no database.
apps.<system>.default, frappe-initThe scaffolder as a flake app.

In a consuming bench that declares secrets, the bench flake also exposes lib.secrets: the declared .age paths and recipients, so a deployment can read the same ciphertext.

What the module adds to your flake

When frappe-nix.enable is set, the module adds these packages to your flake, which you build with nix build .#<name>:

PackageWhat it is
default, builtBenchThe production-ready bench: apps, Python environment, Node and compiled assets. The deployable consumed by the NixOS module and the OCI containers.
prodPythonEnvThe production virtualenv: workspace apps and runtime dependencies, no dev tools.
devPythonEnvThe development virtualenv: adds dev groups and editable installs of apps/*.
benchRootThe unbuilt /bench tree (apps, node_modules, Python environment, site and config). Used by the dev path and as input to builtBench.

and one app, run with nix run .#<name>:

AppWhat it does
relockIn a bench, uv lock in the bench root, from a uv that does not come from the workspace. In app mode it assembles the workspace itself and writes nix/uv.lock, and nix/node-locks/ for pins without a yarn.lock. See Dependencies and locks.

The builtBench package exposes passthru.{pythonEnv, nodejs, appsPath, appNames}, so the NixOS module and the containers can discover interpreters from the package itself.

With containers.enable = true it additionally builds, named <name>/<role>:latest, or <registry>/<name>/<role>:latest with containers.registry set:

  • runtime, nginx and bench-cli (image name bench), or

  • with runtime.enable = false: web, scheduler, worker-default, worker-short, worker-long, socketio, nginx and bench-cli.

See Build production images.

Library

lib.mkFlake

frappe-nix.lib.mkFlake { inherit inputs; } flakeConfig

lib.mkFlake calls flake-parts.lib.mkFlake with inputs = frappe-nix.inputs // yourInputs, so the modules resolve nixpkgs, devenv, pyproject-nix, uv2nix, pyproject-build-systems and nix2container from frappe-nix's pins. Your wrapper only needs to declare frappe-nix, and nixpkgs.follows for the perSystem pkgs.

lib.overrides

Every bench gets python-devops-nix's lib.python.overrides, the fixes frappe-nix and odoo-nix share for packages that need a system library: psycopg2, python-ldap (with OpenLDAP 2.5's ldap_r link fix), lxml, pycups, python-magic, pyvips and cairocffi. A build fix applies only where the package builds from its sdist; a fix to where a package dlopens its library (python-magic, pyvips, cairocffi) patches the installed files, so it reaches a wheel too. Nothing to add.

lib.overrides.mysqlclient is frappe-nix's own, wired in automatically from mariadb.package. A bench's pythonOverrides layer on top of both.

lib.overrides.pycups, python-ldap, pyvips and cairocffi are kept for benches that still list them: each is now a no-op with a warning, since the fix is already applied. Remove them from pythonOverrides: the aliases are kept for all of 1.x, removed in 2.0.0.

Pure-Python build dependencies (setuptools and the like) belong in pyproject.toml under [tool.uv.extra-build-dependencies], which frappe-nix derives from uv.lock; a bench adds its own with pythonBuildDependencies. See Build dependencies. The overlays are only for packages that need C headers or system libraries.