about summary refs log tree commit diff
path: root/pkgs/servers/sql/pgcat/default.nix
blob: 525380e46f24c7d295ad8d694990399661b3bedd (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{
  lib,
  stdenv,
  fetchFromGitHub,
  rustPlatform,
  darwin,
  nix-update-script,
  testers,
  pgcat,
}:

rustPlatform.buildRustPackage rec {
  pname = "pgcat";
  version = "1.2.0";

  src = fetchFromGitHub {
    owner = "postgresml";
    repo = "pgcat";
    rev = "v${version}";
    hash = "sha256-DHXUhAAOmPSt4aVp93I1y69of+MEboXJBZH50mzQTm8=";
  };

  cargoHash = "sha256-QqwUEbWKSUuxzYjWpVpQuKZDiNib1gM2eZJ4y7XIzXY=";

  buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
    darwin.apple_sdk.frameworks.Security
  ];

  checkFlags = [
    # requires network access
    "--skip=dns_cache"
  ];

  passthru = {
    updateScript = nix-update-script { };
    tests.version = testers.testVersion { package = pgcat; };
  };

  meta = with lib; {
    homepage = "https://github.com/postgresml/pgcat";
    description = "PostgreSQL pooler with sharding, load balancing and failover support";
    changelog = "https://github.com/postgresml/pgcat/releases";
    license = with licenses; [ mit ];
    platforms = platforms.unix;
    maintainers = with maintainers; [ cathalmullan ];
    mainProgram = "pgcat";
  };
}