Merge pull request #137176 from GoldsteinE/clickhouse-package
nixos/clickhouse: add package option
This commit is contained in:
commit
0939143e24
2 changed files with 16 additions and 4 deletions
|
@ -13,6 +13,15 @@ with lib;
|
|||
|
||||
enable = mkEnableOption "ClickHouse database server";
|
||||
|
||||
package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.clickhouse;
|
||||
defaultText = "pkgs.clickhouse";
|
||||
description = ''
|
||||
ClickHouse package to use.
|
||||
'';
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -45,21 +54,21 @@ with lib;
|
|||
AmbientCapabilities = "CAP_SYS_NICE";
|
||||
StateDirectory = "clickhouse";
|
||||
LogsDirectory = "clickhouse";
|
||||
ExecStart = "${pkgs.clickhouse}/bin/clickhouse-server --config-file=${pkgs.clickhouse}/etc/clickhouse-server/config.xml";
|
||||
ExecStart = "${cfg.package}/bin/clickhouse-server --config-file=${cfg.package}/etc/clickhouse-server/config.xml";
|
||||
};
|
||||
};
|
||||
|
||||
environment.etc = {
|
||||
"clickhouse-server/config.xml" = {
|
||||
source = "${pkgs.clickhouse}/etc/clickhouse-server/config.xml";
|
||||
source = "${cfg.package}/etc/clickhouse-server/config.xml";
|
||||
};
|
||||
|
||||
"clickhouse-server/users.xml" = {
|
||||
source = "${pkgs.clickhouse}/etc/clickhouse-server/users.xml";
|
||||
source = "${cfg.package}/etc/clickhouse-server/users.xml";
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.clickhouse ];
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
# startup requires a `/etc/localtime` which only if exists if `time.timeZone != null`
|
||||
time.timeZone = mkDefault "UTC";
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
, icu, jemalloc, libcpuid, libxml2, lld, llvm, lz4, libmysqlclient, openssl, perl
|
||||
, poco, protobuf, python3, rapidjson, re2, rdkafka, readline, sparsehash, unixODBC
|
||||
, xxHash, zstd
|
||||
, nixosTests
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
|
@ -64,6 +65,8 @@ stdenv.mkDerivation rec {
|
|||
# Builds in 7+h with 2 cores, and ~20m with a big-parallel builder.
|
||||
requiredSystemFeatures = [ "big-parallel" ];
|
||||
|
||||
passthru.tests.clickhouse = nixosTests.clickhouse;
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://clickhouse.tech/";
|
||||
description = "Column-oriented database management system";
|
||||
|
|
Loading…
Reference in a new issue