nixos/odoo: add autoInit option

When enabled, Odoo will automatically initialize the database on
startup.
This commit is contained in:
zimbatm 2024-07-16 16:12:28 +02:00
parent 750f1478fc
commit c570314635

View File

@ -20,6 +20,8 @@ in
description = "Odoo addons.";
};
autoInit = mkEnableOption "automatically initialize the DB";
settings = mkOption {
type = format.type;
default = {};
@ -113,7 +115,9 @@ in
"HOME=%S/odoo"
"ODOO_RC=${cfgFile}"
];
};
} // (lib.optionalAttrs cfg.autoInit {
ExecStartPre = "${cfg.package}/bin/odoo --init=INIT --database=odoo --db_user=odoo --stop-after-init";
});
};
services.postgresql = {