Unverified Commit e5ad45c4 authored by Julien Malka's avatar Julien Malka Committed by GitHub
Browse files

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

parents edc63aab 08f18205
Loading
Loading
Loading
Loading
+33 −7
Original line number Diff line number Diff line
@@ -19,8 +19,38 @@ 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";
            };

            FERRETDB_POSTGRESQL_URL = lib.mkOption {
              type = lib.types.str;
              default = "postgres://ferretdb@localhost/ferretdb?host=/run/postgresql";
              description = "PostgreSQL URL for 'pg' handler";
            };

            FERRETDB_TELEMETRY = lib.mkOption {
              type = lib.types.enum [ "enable" "disable" ];
              default = "disable";
              description = ''
                Enable or disable basic telemetry.

                See <https://docs.ferretdb.io/telemetry/> for more information.
              '';
            };
          };
        };
        example = {
          FERRETDB_LOG_LEVEL = "warn";
          FERRETDB_MODE = "normal";
@@ -36,11 +66,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";
+0 −1
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ with import ../lib/testing-python.nix { inherit system; };
          services.ferretdb = {
            enable = true;
            settings.FERRETDB_HANDLER = "pg";
            settings.FERRETDB_POSTGRESQL_URL = "postgres://ferretdb@localhost/ferretdb?host=/run/postgresql";
          };

          systemd.services.ferretdb.serviceConfig = {