odoo: always include major version in package name (#488713)

This commit is contained in:
Maciej Krüger
2026-03-18 14:39:42 +00:00
committed by GitHub
6 changed files with 47 additions and 21 deletions
+37 -11
View File
@@ -7,13 +7,23 @@
let
cfg = config.services.odoo;
format = pkgs.formats.ini { };
inherit (config.system) stateVersion;
in
{
options = {
services.odoo = {
enable = lib.mkEnableOption "odoo, an open source ERP and CRM system";
package = lib.mkPackageOption pkgs "odoo" { };
package = lib.mkOption {
type = lib.types.package;
description = "Which package to use for the Odoo instance.";
relatedPackages = [
"odoo17"
"odoo18"
"odoo19"
];
};
addons = lib.mkOption {
type = with lib.types; listOf package;
@@ -100,16 +110,32 @@ in
};
};
services.odoo.settings.options = {
data_dir = "/var/lib/private/odoo/data";
proxy_mode = cfg.domain != null;
# Disable the database manager by default
# https://www.odoo.com/documentation/master/administration/on_premise/deploy.html#database-manager-security
list_db = lib.mkDefault false;
}
// (lib.optionalAttrs (cfg.addons != [ ]) {
addons_path = lib.concatMapStringsSep "," lib.escapeShellArg cfg.addons;
});
services.odoo = {
package = lib.mkDefault (
if pkgs ? odoo then
throw ''
The `pkgs.odoo`-attribute has been removed. If it's supposed to be the default
odoo defined in an overlay, please set `services.odoo.package` to
`pkgs.odoo`.
''
else if lib.versionOlder stateVersion "25.05" then
pkgs.odoo18
else if lib.versionOlder stateVersion "25.11" then
pkgs.odoo18
else
pkgs.odoo19
);
settings.options = {
data_dir = "/var/lib/private/odoo/data";
proxy_mode = cfg.domain != null;
# Disable the database manager by default
# https://www.odoo.com/documentation/master/administration/on_premise/deploy.html#database-manager-security
list_db = lib.mkDefault false;
}
// (lib.optionalAttrs (cfg.addons != [ ]) {
addons_path = lib.concatMapStringsSep "," lib.escapeShellArg cfg.addons;
});
};
users.users.odoo = {
isSystemUser = true;
+8 -5
View File
@@ -1177,15 +1177,18 @@ in
ocsinventory-agent = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./ocsinventory-agent.nix { };
octoprint = runTest ./octoprint.nix;
oddjobd = handleTestOn [ "x86_64-linux" "aarch64-linux" ] ./oddjobd.nix { };
odoo = runTest ./odoo.nix;
odoo16 = runTest {
imports = [ ./odoo.nix ];
_module.args.package = pkgs.odoo16;
};
odoo17 = runTest {
imports = [ ./odoo.nix ];
_module.args.package = pkgs.odoo17;
};
odoo18 = runTest {
imports = [ ./odoo.nix ];
_module.args.package = pkgs.odoo18;
};
odoo19 = runTest {
imports = [ ./odoo.nix ];
_module.args.package = pkgs.odoo19;
};
oh-my-zsh = runTest ./oh-my-zsh.nix;
oku = runTest ./oku.nix;
olivetin = runTest ./olivetin.nix;
-3
View File
@@ -1,15 +1,12 @@
{
package,
lib,
pkgs,
...
}:
{
name = "odoo";
meta.maintainers = with lib.maintainers; [ mkg20001 ];
_module.args.package = lib.mkDefault pkgs.odoo;
nodes.server = {
services.nginx = {
enable = true;
+1 -1
View File
@@ -94,7 +94,7 @@ python.pkgs.buildPythonApplication rec {
passthru = {
updateScript = ./update.sh;
tests = {
inherit (nixosTests) odoo;
inherit (nixosTests) odoo18;
};
};
@@ -92,7 +92,7 @@ python.pkgs.buildPythonApplication rec {
passthru = {
updateScript = ./update.sh;
tests = {
inherit (nixosTests) odoo;
inherit (nixosTests) odoo19;
};
};