From 3b3764df0987db25682798a17b7f9f9aa381c26f Mon Sep 17 00:00:00 2001 From: Minijackson Date: Tue, 13 Feb 2024 10:51:01 +0100 Subject: [PATCH] nixos/ferretdb: set default value for PostgreSQL URL provides a nice default if the end user wants to use the PostgreSQL backend --- nixos/modules/services/databases/ferretdb.nix | 6 ++++++ nixos/tests/ferretdb.nix | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/databases/ferretdb.nix b/nixos/modules/services/databases/ferretdb.nix index 21754b3d1bbc..bc213095a91e 100644 --- a/nixos/modules/services/databases/ferretdb.nix +++ b/nixos/modules/services/databases/ferretdb.nix @@ -33,6 +33,12 @@ in 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"; + }; }; }; example = { diff --git a/nixos/tests/ferretdb.nix b/nixos/tests/ferretdb.nix index 7251198af77d..8e6e7b6a3219 100644 --- a/nixos/tests/ferretdb.nix +++ b/nixos/tests/ferretdb.nix @@ -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 = {