Jump to
↵select↑↓navigateescclose

Reference

Dev shell options

Every perSystem.odoo-nix option that configures the development shell, the production packages and the container image, with types and defaults.

Updated
Tags
  • reference
  • options
  • devenv
On this page

All of these are under perSystem.odoo-nix. Secrets are declared at the top level instead: see Secrets options. Options renamed in 1.x are listed in Upgrading odoo-nix.

The project

OptionTypeDefaultDescription
enableboolfalseBuild the dev shell and the packages.
namestringrequiredThe project's identity, a slug: names its environments, packages and container image, seeds the port offset, and is devenv's own name by default.
workspaceRootpathrequiredThe project root, where pyproject.toml, odoo.conf and the layout directories live. Usually ./..
coreSourcenull or pathnullOCB from outside the workspace, typically a flake = false input, instead of the odoo/ submodule. See A repository of modules.
odooSeriesstring"18.0"The Odoo series: the OCB and OCA branch and the catalog filter. It does not pick a nixpkgs package.
pythonpackagethe series' preset: python311 for 18.0, python312 for 19.0 and 20.0The interpreter. Match the series' requires-python.
nodejspackagepkgs.nodejs_22Node.js, for rtlcss and asset tooling.
pythonOverridesoverlay_: _: { }A uv2nix package-set overlay, applied last.
pythonLibrariesattrs of lists of packages{ }Native libraries for a Python package's build, by package name, e.g. { python-snappy = [ pkgs.snappy ]; }. See C extensions.
testBrowsernull or packagepkgs.chromiumThe browser Odoo's browser tours drive. null relies on one on PATH; without any, odoo test refuses to run.

Layout

OptionTypeDefaultDescription
layout.coreSrcstring"odoo"The OCB submodule, or the symlink coreSource maintains.
layout.externalDirstring"modules"The directory of module-repository submodules.
layout.customDirstring"custom"The directory of your own modules. "." for a repository of modules.
layout.extraAddonslist of strings[ ]Extra addons_path entries, relative to the workspace, appended after customDir.

odoo.conf: settings

Rendered into the dev shell's odoo.conf [options]. The production module has its own options; see services.odoo-nix options.

OptionTypeDefaultDescription
settings.dbHoststring"127.0.0.1"db_host. Empty or "False" leaves it out: the unix socket.
settings.dbUserstring"odoo"db_user, and the dev PostgreSQL role, created as a superuser.
settings.dbPasswordstring"False"db_password. Empty or "False" leaves it out.
settings.dbNamenull or string"odoo_dev"db_name, the default database, created empty in the dev PostgreSQL. The scaffolder sets it from --db.
settings.dataDirstring"./.devenv/state/odoo"data_dir, the filestore.
settings.adminPasswdstring"admin"admin_passwd, the database manager's master password. Development only.
settings.httpInterfacestring"127.0.0.1"http_interface. "0.0.0.0" to reach the server from another host or container.
settings.workersint0workers. 0 is the threaded server, which live reload needs.
settings.devModestring"all"The dev process's --dev flag. Not written to odoo.conf.
settings.withoutDemoboolfalsewithout_demo = True: no demo data for any module.
settings.logging.levelenum"info"log_level.
settings.logging.handlerslist of "logger:LEVEL"[ ]log_handler, e.g. [ "werkzeug:WARNING" ].
settings.logging.dbbool or stringfalselog_db: true is the request's own database (%d), a string that database.
settings.logging.dbLevelenum"warning"log_db_level.
settings.logging.filenull or stringnulllogfile. Odoo's file and stderr handlers are exclusive, so the console then stays quiet.
settings.extraattrs of string, int or bool{ }Any other [options] key, merged last.

odoo.conf also gets http_port, gevent_port and db_port from ports, and server_wide_modules (base,web, and rpc from 19.0 on).

Ports

OptionTypeDefaultDescription
ports.offsetint, 0 to 899a hash of nameThe offset every port is derived from. ODOO_NIX_PORT_OFFSET overrides it for one shell.
ports.worktreeSaltbooltrueA linked worktree hashes name@<path>, so it gets its own ports.
ports.basenull or portnullPin the HTTP port alone.
ports.httpportports.base, else 10000 + offsetOdoo's http_port.
ports.geventport11000 + offsetOdoo's gevent_port.
ports.dbport12000 + offsetPostgreSQL's port and db_port.
ports.smtpport13000 + offsetMailpit's SMTP port.
ports.mailUiport14000 + offsetMailpit's web UI.

The derived ports are read by the rest of the module; pin one with lib.mkForce. See Ports.

Mailpit and reload

OptionTypeDefaultDescription
mailpit.enablebooltrueRun Mailpit, before the server, whether or not the mail guard is on.
mailpit.hoststring"127.0.0.1"The SMTP listener's host, which the mail guard redirects to.
mailpit.portportports.smtpThe SMTP port.
mailpit.httpPortportports.mailUiThe web UI's port.
watch.pythonbooltrueMake Odoo's --dev=reload watcher work by providing watchdog. See Live reload.

Guard rails: devguard

See Development guard rails.

OptionTypeDefaultDescription
devguard.enablebooltrueGraft the guard rails into the dev and test environments. Off, odoo db restore refuses to run.
devguard.egress.enablebooltrueRefuse every non-loopback connection from Odoo's Python.
devguard.egress.allowHostslist of strings[ ]Destinations to let through: hostnames (*.example.com), IP literals or CIDRs.
devguard.mail.enablebooltrueRedirect all outgoing mail to Mailpit; refuse IMAP and POP3.
devguard.jobs.enablebooltrueSkip denylisted scheduled actions.
devguard.jobs.extraBlockedlist of strings[ ]More cron external ids (<module>.<name>) to skip.
devguard.objectstore.enablebooltrueRefuse to open an fs.storage that is not local.
devguard.backups.enablebooltrueSkip auto_backup jobs to a remote destination, and their retention.
devguard.webhooks.enablebooltrueMake outbound webhook actions do nothing.
devguard.iap.enablebooltrueMake IAP calls fail with a readable error.

Restore: restore

See Restore a production backup.

OptionTypeDefaultDescription
restore.enableboolsecrets.backupAccess.enableOffer setup-backup-access and let odoo db restore decrypt the backup-access secret.
restore.sourceDatabasestring""The database folder to restore from. Empty: the target's name.
restore.prefixstring""The bucket prefix, when the secret has no BACKUPS_PREFIX.
restore.filesboolfalseAlso mirror object-store attachments (--files).
restore.neutralizebooltrueNeutralize restored databases.
restore.migratebooltrueRun odoo db migrate on a restored database.
restore.requireDevguardbooltrueRefuse to restore while devguard.enable is false.

PostgreSQL, editors and extras

OptionTypeDefaultDescription
postgres.extensionsfunction to list of packages_: [ ]Extensions built into the dev PostgreSQL 16, e.g. ps: [ ps.postgis ]. The dev role is a superuser, so a module can create them itself.
postgres.noCowbooltrueOn btrfs, keep the data directory off copy-on-write (Linux). See Memory and disk.
ide.enablebooltrueCreate ./.venv and the merged analysis root.
ide.vscodeSettingsbooltrueSeed .vscode/settings.json (and extensions.json) when absent. Never overwrites.
ide.languageServer.enablebooltruePut odoo_ls_server on PATH and link ./odools.toml. Needs ide.enable.
ide.languageServer.packagepackageodoo-ls from odoo-nix's pinned inputsThe odoo_ls_server to use.
extraDevPackageslist of packages[ ]More packages in the shell.
extraLibraryPathslist of packages[ ]More packages on LD_LIBRARY_PATH.
extraScriptsattrs{ }More devenv scripts.
extraEnvattrs of strings{ }More environment variables.

Containers

OptionTypeDefaultDescription
containers.enableboolfalseBuild packages.container-odoo. See The container image.
containers.registrystring""A prefix for the image's name: "ghcr.io/avunu" names it ghcr.io/avunu/<name>-odoo, or ghcr.io/avunu/<name>/odoo with roleImageNames.
containers.roleImageNamesboolfalseName the image <name>/odoo instead of 1.0's <name>-odoo; building under the old name warns. The default becomes true in 2.0.0. See The image name.
containers.nonRootboolfalseRun the image as odoo (uid/gid 1000) instead of root. The default becomes true in 2.0.0; an existing filestore volume needs a one-time chown first. See Running as non-root.
containers.labelsattribute set of strings{ }Image labels over the org.opencontainers.image.* ones, which describe odoo-nix. See Labels.