nixos/ferretdb: move default settings to options

so that they are documented in the options list
This commit is contained in:
Minijackson 2024-02-13 10:49:26 +01:00
parent e8711e1591
commit ccd19c4503
No known key found for this signature in database
GPG Key ID: FEA888C9F5D64F62

View File

@ -19,8 +19,22 @@ in
};
settings = lib.mkOption {
type =
lib.types.submodule { freeformType = with lib.types; attrsOf str; };
type = lib.types.submodule {
freeformType = with lib.types; attrsOf str;
options = {
FERRETDB_HANDLER = lib.mkOption {
type = lib.types.enum [ "sqlite" "pg" ];
default = "sqlite";
description = "Backend handler";
};
FERRETDB_SQLITE_URL = lib.mkOption {
type = lib.types.str;
default = "file:/var/lib/ferretdb/";
description = "SQLite URI (directory) for 'sqlite' handler";
};
};
};
example = {
FERRETDB_LOG_LEVEL = "warn";
FERRETDB_MODE = "normal";
@ -36,11 +50,7 @@ in
config = lib.mkIf cfg.enable
{
services.ferretdb.settings = {
FERRETDB_HANDLER = lib.mkDefault "sqlite";
FERRETDB_SQLITE_URL = lib.mkDefault "file:/var/lib/ferretdb/";
};
services.ferretdb.settings = { };
systemd.services.ferretdb = {
description = "FerretDB";