mirror of
https://github.com/juspay/services-flake.git
synced 2024-09-17 15:28:33 +03:00
clickhouse: use lib.recursiveUpdate
to deep merge extraConfig (#110)
This commit is contained in:
parent
625f207034
commit
ef2f930e1a
@ -27,6 +27,28 @@ in
|
||||
description = "The clickhouse data directory";
|
||||
};
|
||||
|
||||
defaultExtraConfig = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
internal = true;
|
||||
readOnly = true;
|
||||
default = {
|
||||
logger.level = "warning";
|
||||
logger.console = 1;
|
||||
default_profile = "default";
|
||||
default_database = "default";
|
||||
tcp_port = toString config.port;
|
||||
path = "${config.dataDir}/clickhouse";
|
||||
tmp_path = "${config.dataDir}/clickhouse/tmp";
|
||||
user_files_path = "${config.dataDir}/clickhouse/user_files";
|
||||
format_schema_path = "${config.dataDir}/clickhouse/format_schemas";
|
||||
user_directories = {
|
||||
users_xml = {
|
||||
path = "${config.package}/etc/clickhouse-server/users.xml";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = lib.mkOption {
|
||||
type = yamlFormat.type;
|
||||
description = "Additional configuration to be appended to `clickhouse-config.yaml`.";
|
||||
@ -75,24 +97,7 @@ in
|
||||
processes =
|
||||
let
|
||||
clickhouseConfig = yamlFormat.generate "clickhouse-config.yaml" (
|
||||
{
|
||||
logger = {
|
||||
level = "warning";
|
||||
console = 1;
|
||||
};
|
||||
tcp_port = "${toString config.port}";
|
||||
default_profile = "default";
|
||||
default_database = "default";
|
||||
path = "${config.dataDir}/clickhouse";
|
||||
tmp_path = "${config.dataDir}/clickhouse/tmp";
|
||||
user_files_path = "${config.dataDir}/clickhouse/user_files";
|
||||
format_schema_path = "${config.dataDir}/clickhouse/format_schemas";
|
||||
user_directories = {
|
||||
users_xml = {
|
||||
path = "${config.package}/etc/clickhouse-server/users.xml";
|
||||
};
|
||||
};
|
||||
} // config.extraConfig
|
||||
lib.recursiveUpdate config.defaultExtraConfig config.extraConfig
|
||||
);
|
||||
in
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user