Jump to
↵select↑↓navigateescclose

Reference

services.odoo-nix options

Every option of the odoo-nix NixOS module, with types and defaults.

Updated
Tags
  • reference
  • options
  • nixos
On this page

See Run Odoo as a NixOS service for how they fit together.

The service

OptionTypeDefaultDescription
enableboolfalseRun Odoo.
packagepackagerequiredThe project's packages.default, the odoo command.
adminClibooltrueInstall the operator's odoo command.
user, groupstring"odoo"The service's user and group. A user named odoo is created.
stateDirpath"/var/lib/odoo"The runtime odoo.conf and the filestore (<stateDir>/data).
http.portport8069http_port.
http.longpollingPortport8072gevent_port, the websocket process.
http.interfacestring"127.0.0.1"http_interface. Keep loopback behind nginx.
workersint2HTTP worker processes. 0 is the threaded server.
maxCronThreadsint2max_cron_threads.
dbNamenull or stringnullPin one database: sets db_name and dbfilter = ^<NAME>$.
dbFilterstring""An explicit dbfilter for several databases; wins over dbName's.
listDbboolfalselist_db: allow the database manager and listing.
withoutDemoboolfalsewithout_demo = True.
adminPasswordFilenull or pathnullA file with admin_passwd, read through LoadCredential.
settingsattrs of string, int or bool{ }Any other [options] key. No secrets.
extraEnvattrs of strings{ }More environment for the units and the operator's command.
environmentFileslist of paths[ ]systemd EnvironmentFile=s for odoo and odoo-migrate, such as the backup credentials.
hardening.enableboolfalseRun every unit under python-devops-nix's sandboxing baseline. On by default from 2.0.0.

Database

OptionTypeDefaultDescription
database.createLocallyboolfalseRun PostgreSQL on the host; with no passwordFile, connect over the socket with peer authentication.
database.hoststring"127.0.0.1"db_host, when not using the local socket.
database.portport5432db_port, likewise.
database.userstring"odoo"db_user. Created with CREATEDB locally, and given ownership of dbName.
database.passwordFilenull or pathnullA file with db_password, read through LoadCredential.
database.extensionsfunction to list of packages_: [ ]Extensions built into the local server, e.g. ps: [ ps.postgis ].
database.ensureExtensionslist of strings[ ]Extensions created in dbName as the superuser. Needs createLocally and dbName.
database.slowQueryMsnull or unsigned intnulllog_min_duration_statement. Was logging.slowQueryMs. Local server only.

Migrations and first start

OptionTypeDefaultDescription
migrate.enablebooltrueRun odoo-migrate before every start of Odoo.
migrate.snapshotbooltrueTake a verified pg_dump snapshot first.
migrate.rollbackOnFailurebooltrueRestore the snapshot when the migration fails.
migrate.snapshotRetentionpositive int3Snapshots kept per database.
migrate.fullboolfalseUpdate every installed module on each new build.
migrate.timeoutstring"infinity"TimeoutStartSec of odoo-migrate.
updatelist of strings[ ]Modules to update on every deploy even when unchanged. Needs dbName.
autoInitboolfalseProvision an empty dbName on first start: base and <stateDir>/modules.txt. Needs dbName.

See Migrations on deploy.

nginx

OptionTypeDefaultDescription
nginx.enableboolfalseAn nginx virtual host in front of Odoo, with proxy_mode on.
nginx.domainstring""The virtual host's server name. Required unless socketPath is set.
nginx.clientMaxBodySizestring"64m"client_max_body_size.
nginx.socketPathstring""Listen on this unix socket instead of TCP. Give it a directory of its own.
nginx.xSendfileboolfalseLet nginx send filestore attachments (x_sendfile).

Logging

OptionTypeDefaultDescription
logging.levelenum"info"log_level.
logging.handlerslist of "logger:LEVEL"[ ]log_handler.
logging.dbbool or stringfalselog_db: true is the request's database (%d).
logging.dbLevelenum"warning"log_db_level.
logging.accessLogbooltruenginx's JSON access log in the journal.
logging.filenull or pathnulllogfile. Leave it null under systemd.
logging.rotateboolfalseRotate logging.file with logrotate. Needs logging.file.
logging.journaldnull or boolnullDeprecated and without effect.

See Logging.