summary refs log tree commit diff
path: root/pkgs/tools/filesystems/zfstools/default.nix
blob: 0a4447bacc4f3e9b7e5e8f36afdd494e48f4763d (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
{ lib, stdenv, fetchFromGitHub, ruby, zfs, makeWrapper }:

stdenv.mkDerivation rec {
  pname = "zfstools";
  version = "0.3.6";

  src = fetchFromGitHub {
    sha256 = "16lvw3xbmxp2pr8nixqn7lf4504zaaxvbbdnjkv4dggwd4lsdjyg";
    rev = "v${version}";
    repo = "zfstools";
    owner = "bdrewery";
  };

  buildInputs = [ ruby ];
  nativeBuildInputs = [ makeWrapper ];

  installPhase = ''
    mkdir -p $out/bin
    cp bin/* $out/bin/

    cp -R lib $out/

    for f in $out/bin/*; do
      wrapProgram $f \
        --set RUBYLIB $out/lib \
        --prefix PATH : ${zfs}/bin
    done
  '';

  meta = with lib; {
    inherit version;
    inherit (src.meta) homepage;
    description = "OpenSolaris-compatible auto-snapshotting script for ZFS";
    longDescription = ''
      zfstools is an OpenSolaris-like and compatible auto snapshotting script
      for ZFS, which also supports auto snapshotting mysql databases.
    '';
    license = licenses.bsd2;
    platforms = platforms.linux;
  };
}