nixpkgs/pkgs/tools/filesystems/zfstools/default.nix

41 lines
1 KiB
Nix
Raw Normal View History

2015-04-18 21:51:40 +02:00
{ stdenv, fetchFromGitHub, ruby, zfs }:
2016-10-14 02:02:03 +02:00
let version = "0.3.6"; in
stdenv.mkDerivation rec {
name = "zfstools-${version}";
2015-04-18 21:51:40 +02:00
src = fetchFromGitHub {
2016-10-14 02:02:03 +02:00
sha256 = "16lvw3xbmxp2pr8nixqn7lf4504zaaxvbbdnjkv4dggwd4lsdjyg";
2015-04-18 21:51:40 +02:00
rev = "v${version}";
repo = "zfstools";
owner = "bdrewery";
};
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
'';
2015-09-15 08:50:46 +02:00
meta = with stdenv.lib; {
2015-04-18 21:51:40 +02:00
inherit version;
2015-09-15 08:50:46 +02:00
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.
'';
2015-09-15 08:50:46 +02:00
license = licenses.bsd2;
platforms = platforms.linux;
};
}