Repository navigation
odoo: 0..n local instances with odoo-reset and odoo-purge - #38
Merged
Merged
Conversation
hostSpec.services.odoo ran one instance through nixpkgs services.odoo, whose unit, database and ports are fixed, and its demo data could only be reset by hand (dropping the database without the init marker broke it). Local testing needs several instances, demo and blank, and a one-command way back to a fresh database. Breaking: the single instance (odoo.service, database odoo, https://odoo.localhost) becomes hostSpec.services.odoo.instances.<name>, each odoo-<name> (unit, user, role, database, state) at https://<name>.odoo.localhost; odoo.localhost is an index. One certificate covers *.odoo.localhost (odoo-tls regenerates once; the CA is unchanged), passwords are shared. odoo-reset recreates an instance's database with or without demo data; odoo-purge removes what removed instances leave. VM tests: odoo, odoo-reset, odoo-firefox (a home-manager Firefox trusts the CA). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
andrewthomaslee
enabled auto-merge (squash)
November 12, 2026 17:14
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
hostSpec.services.odoogoes from one fixed instance (nixpkgsservices.odoo) to 0..n local test instances, each resettable to a fresh database.hostSpec.services.odoo = { enable = true; - domain = "odoo.localhost"; # one instance: odoo.service, db odoo - demoData = true; workers = 2; addons = []; + baseDomain = "odoo.localhost"; # https://odoo.localhost = index page + instances = { + demo = {}; # https://demo.odoo.localhost, demo data + blank.demoData = false; # https://blank.odoo.localhost, empty + }; };Per instance
<name>, everything isodoo-<name>: unit, system user, PostgreSQL role and database (peer auth), state/var/lib/private/odoo-<name>, config/run/odoo-<name>/odoo.cfg. Ports are automatic frombasePort18069 (orport), loopback only.Files:
flake-parts/nixosModules/odoo.nix: own units instead of nixpkgsservices.odoo(single-instance); one cert forodoo.localhost+*.odoo.localhost(CA name constraint unchanged); shared passwords; index page;odoo-reset,odoo-purge. PostgreSQL stays on while enabled, even with no instances, soodoo-purgealways works.vm-tests/odoo.nix(rewritten),vm-tests/odoo-reset.nix,vm-tests/odoo-firefox.nix(new),_odoo-common.nix(fake secrets, helpers),_odoo-probe.py(per-instance probe).tests/fixtures/nixos.nix: two instances undereval-all-enabled.documentation/docs/odoo.md(new, in nav): usage, reset, purge, one-time cleanup of the old single instance. README/index link to it.Evidence
dropdb, which left the.odoo.initializedmarker and an Odoo pointed at an empty database. Firefox trust was only asserted as "policies.json exists".After: all on euc-hel-0, sandboxed builds, exit 0:
Merge Danger
Door: two-way
Breaking option change (no shim, per org practice):
domain,demoData,workers,addonsmove underinstances.<name>. The old instance's data (odoodatabase/role,/var/lib/private/odoo) is left in place, not migrated; deleting it is a manual step in the docs.Blast Radius: beelink
Only beelink enables Odoo. Merge order: this PR, then the home PR bumps
modulesand gives beelinkdemo+blank. On deploy:clan vars generate beelinkregeneratesodoo-tls(wildcard SAN); the CA stays, so Firefox keeps trusting it. URL change:https://odoo.localhostbecomes the index; instances move tohttps://demo.odoo.localhost/https://blank.odoo.localhost.🤖 Generated with Claude Code