diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index af698b0d8358..505501ba1fa8 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -584,11 +584,14 @@ in config = { dbtype = mkOption { - type = types.enum [ - "sqlite" - "pgsql" - "mysql" - ]; + type = types.nullOr ( + types.enum [ + "sqlite" + "pgsql" + "mysql" + ] + ); + default = null; description = "Database type."; }; dbname = mkOption { @@ -1093,6 +1096,17 @@ in instead of password. ''; } + { + assertion = cfg.config.dbtype != null; + message = '' + `services.nextcloud.config.dbtype` must be set explicitly (pgsql, mysql, or sqlite) + + Before 25.05, it used to default to sqlite but that is not recommended by upstream. + Either set it to sqlite as it used to be, or convert to another type as described + in the official db conversion page: + https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/db_conversion.html + ''; + } ]; }