depot/third_party/nixpkgs/pkgs/tools/filesystems/zfstools/default.nix
Default email d87170d3f2 Project import generated by Copybara.
GitOrigin-RevId: 967d40bec14be87262b21ab901dbace23b7365db
2021-07-18 23:22:44 +02:00

40 lines
1,023 B
Nix

{ lib, stdenv, fetchFromGitHub, ruby, zfs }:
stdenv.mkDerivation rec {
pname = "zfstools";
version = "0.3.6";
src = fetchFromGitHub {
sha256 = "16lvw3xbmxp2pr8nixqn7lf4504zaaxvbbdnjkv4dggwd4lsdjyg";
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
'';
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;
};
}