FerretDB document defaults, PostgreSQL default URL, disable telemetry (#288493)

authored by

Julien Malka and committed by
GitHub
e5ad45c4 edc63aab

+33 -8
+33 -7
nixos/modules/services/databases/ferretdb.nix
··· 19 }; 20 21 settings = lib.mkOption { 22 - type = 23 - lib.types.submodule { freeformType = with lib.types; attrsOf str; }; 24 example = { 25 FERRETDB_LOG_LEVEL = "warn"; 26 FERRETDB_MODE = "normal"; ··· 36 37 config = lib.mkIf cfg.enable 38 { 39 - 40 - services.ferretdb.settings = { 41 - FERRETDB_HANDLER = lib.mkDefault "sqlite"; 42 - FERRETDB_SQLITE_URL = lib.mkDefault "file:/var/lib/ferretdb/"; 43 - }; 44 45 systemd.services.ferretdb = { 46 description = "FerretDB";
··· 19 }; 20 21 settings = lib.mkOption { 22 + type = lib.types.submodule { 23 + freeformType = with lib.types; attrsOf str; 24 + options = { 25 + FERRETDB_HANDLER = lib.mkOption { 26 + type = lib.types.enum [ "sqlite" "pg" ]; 27 + default = "sqlite"; 28 + description = "Backend handler"; 29 + }; 30 + 31 + FERRETDB_SQLITE_URL = lib.mkOption { 32 + type = lib.types.str; 33 + default = "file:/var/lib/ferretdb/"; 34 + description = "SQLite URI (directory) for 'sqlite' handler"; 35 + }; 36 + 37 + FERRETDB_POSTGRESQL_URL = lib.mkOption { 38 + type = lib.types.str; 39 + default = "postgres://ferretdb@localhost/ferretdb?host=/run/postgresql"; 40 + description = "PostgreSQL URL for 'pg' handler"; 41 + }; 42 + 43 + FERRETDB_TELEMETRY = lib.mkOption { 44 + type = lib.types.enum [ "enable" "disable" ]; 45 + default = "disable"; 46 + description = '' 47 + Enable or disable basic telemetry. 48 + 49 + See <https://docs.ferretdb.io/telemetry/> for more information. 50 + ''; 51 + }; 52 + }; 53 + }; 54 example = { 55 FERRETDB_LOG_LEVEL = "warn"; 56 FERRETDB_MODE = "normal"; ··· 66 67 config = lib.mkIf cfg.enable 68 { 69 + services.ferretdb.settings = { }; 70 71 systemd.services.ferretdb = { 72 description = "FerretDB";
-1
nixos/tests/ferretdb.nix
··· 26 services.ferretdb = { 27 enable = true; 28 settings.FERRETDB_HANDLER = "pg"; 29 - settings.FERRETDB_POSTGRESQL_URL = "postgres://ferretdb@localhost/ferretdb?host=/run/postgresql"; 30 }; 31 32 systemd.services.ferretdb.serviceConfig = {
··· 26 services.ferretdb = { 27 enable = true; 28 settings.FERRETDB_HANDLER = "pg"; 29 }; 30 31 systemd.services.ferretdb.serviceConfig = {