2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, ruby, zfs }:
|
2014-01-21 18:47:04 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "zfstools";
|
2021-07-17 18:56:23 +01:00
|
|
|
version = "0.3.6";
|
2014-01-21 18:47:04 +00:00
|
|
|
|
2015-04-18 20:51:40 +01:00
|
|
|
src = fetchFromGitHub {
|
2016-10-14 01:02:03 +01:00
|
|
|
sha256 = "16lvw3xbmxp2pr8nixqn7lf4504zaaxvbbdnjkv4dggwd4lsdjyg";
|
2015-04-18 20:51:40 +01:00
|
|
|
rev = "v${version}";
|
|
|
|
repo = "zfstools";
|
|
|
|
owner = "bdrewery";
|
2014-01-21 18:47:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ ruby ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp bin/* $out/bin/
|
|
|
|
|
|
|
|
cp -R lib $out/
|
|
|
|
|
|
|
|
for f in $out/bin/*; do
|
|
|
|
substituteInPlace $f --replace "/usr/bin/env ruby" "ruby -I$out/lib"
|
|
|
|
done
|
|
|
|
|
|
|
|
sed -e 's|cmd.*=.*"zfs |cmd = "${zfs}/sbin/zfs |g' -i $out/lib/zfstools/{dataset,snapshot}.rb
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2015-04-18 20:51:40 +01:00
|
|
|
inherit version;
|
2015-09-15 07:50:46 +01:00
|
|
|
inherit (src.meta) homepage;
|
|
|
|
description = "OpenSolaris-compatible auto-snapshotting script for ZFS";
|
2014-01-21 18:47:04 +00:00
|
|
|
longDescription = ''
|
|
|
|
zfstools is an OpenSolaris-like and compatible auto snapshotting script
|
|
|
|
for ZFS, which also supports auto snapshotting mysql databases.
|
|
|
|
'';
|
2015-09-15 07:50:46 +01:00
|
|
|
license = licenses.bsd2;
|
2016-08-02 18:50:55 +01:00
|
|
|
platforms = platforms.linux;
|
2014-01-21 18:47:04 +00:00
|
|
|
};
|
|
|
|
}
|