about summary refs log tree commit diff
path: root/pkgs/tools/misc/mysqltuner/default.nix
blob: f4dbf2cef6e1271d5be5d9b1f5cae3b6c82068e4 (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
{ lib, stdenv, fetchFromGitHub, perl }:

stdenv.mkDerivation rec {
  pname = "mysqltuner";
  version = "1.8.3";

  src = fetchFromGitHub {
    owner = "major";
    repo = "MySQLTuner-perl";
    rev = version;
    sha256 = "sha256-ezF0zjQB/KWD5rUcbXx2uwiNLsIJ7ZKMoqkclP7oc98=";
  };

  postPatch = ''
    substituteInPlace mysqltuner.pl \
      --replace '/usr/share' "$out/share"
  '';

  buildInputs = [ perl ];

  installPhase = ''
    runHook preInstall

    install -Dm0555 mysqltuner.pl $out/bin/mysqltuner
    install -Dm0444 -t $out/share/mysqltuner basic_passwords.txt vulnerabilities.csv

    runHook postInstall
  '';

  meta = with lib; {
    description = "Make recommendations for increased performance and stability of MariaDB/MySQL";
    homepage = "https://mysqltuner.com/";
    license = licenses.gpl3Plus;
    maintainers = with maintainers; [ peterhoeg shamilton ];
  };
}