diff --git a/nixos/modules/services/databases/ferretdb.nix b/nixos/modules/services/databases/ferretdb.nix index a7e3fa81c48f..21754b3d1bbc 100644 --- a/nixos/modules/services/databases/ferretdb.nix +++ b/nixos/modules/services/databases/ferretdb.nix @@ -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";