lol
1{ lib, stdenv, fetchFromGitHub, ruby, zfs, makeWrapper }:
2
3stdenv.mkDerivation rec {
4 pname = "zfstools";
5 version = "0.3.6";
6
7 src = fetchFromGitHub {
8 sha256 = "16lvw3xbmxp2pr8nixqn7lf4504zaaxvbbdnjkv4dggwd4lsdjyg";
9 rev = "v${version}";
10 repo = "zfstools";
11 owner = "bdrewery";
12 };
13
14 buildInputs = [ ruby ];
15 nativeBuildInputs = [ makeWrapper ];
16
17 installPhase = ''
18 mkdir -p $out/bin
19 cp bin/* $out/bin/
20
21 cp -R lib $out/
22
23 for f in $out/bin/*; do
24 wrapProgram $f \
25 --set RUBYLIB $out/lib \
26 --prefix PATH : ${zfs}/bin
27 done
28 '';
29
30 meta = with lib; {
31 inherit version;
32 inherit (src.meta) homepage;
33 description = "OpenSolaris-compatible auto-snapshotting script for ZFS";
34 longDescription = ''
35 zfstools is an OpenSolaris-like and compatible auto snapshotting script
36 for ZFS, which also supports auto snapshotting mysql databases.
37 '';
38 license = licenses.bsd2;
39 platforms = platforms.linux;
40 };
41}