about summary refs log tree commit diff
path: root/modules/clickhouse.nix
blob: 6bb53bbbd70a33e9d5d0ee643e93f0d002835a88 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{
  config,
  inputs,
  lib,
  this,
  ...
}:
with lib;
let
  cfg = config.nixfiles.modules.clickhouse;
in
{
  options.nixfiles.modules.clickhouse = {
    enable = mkEnableOption "Clickhouse";
  };

  config = mkIf cfg.enable {
    services.clickhouse = {
      enable = true;
    };

    topology = {
      nodes.${this.hostname}.services.clickhouse = {
        name = "ClickHouse";
        icon = "${inputs.homelab-svg-assets}/assets/postgresql.svg";
        details.listen.text = "127.0.0.1:8123";
      };
    };
  };
}

Consider giving Nix/NixOS a try! <3