Skip to content

Commit 7fd6b59

Browse files
committed
zfstools: 0.3.6 -> 0.1.0 (Python rewrite)
Switch to the Python reimplementation from Mic92/zfstools-py. The Ruby zfstools pulled ruby, bundler and a gem environment into the closure of every system using services.zfs.autoSnapshot; the Python version only needs the python3 interpreter already present on most systems. CLI and snapshotting semantics are unchanged, except MySQL/PostgreSQL quiescing which is intentionally not supported.
1 parent 9b5b340 commit 7fd6b59

4 files changed

Lines changed: 16 additions & 62 deletions

File tree

pkgs/by-name/zf/zfstools/Gemfile

Lines changed: 0 additions & 3 deletions
This file was deleted.

pkgs/by-name/zf/zfstools/Gemfile.lock

Lines changed: 0 additions & 14 deletions
This file was deleted.

pkgs/by-name/zf/zfstools/gemset.nix

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,37 @@
11
{
22
lib,
3-
bundlerEnv,
43
stdenv,
4+
python3Packages,
55
fetchFromGitHub,
66
zfs,
77
freebsd,
8-
makeWrapper,
98
}:
10-
let
11-
rubyEnv = bundlerEnv {
12-
name = "zfstools-gems";
13-
gemdir = ./.;
14-
};
15-
in
169

17-
stdenv.mkDerivation (finalAttrs: {
10+
python3Packages.buildPythonApplication {
1811
pname = "zfstools";
19-
version = "0.3.6";
12+
version = "0.1.0";
13+
pyproject = true;
2014

2115
src = fetchFromGitHub {
22-
owner = "bdrewery";
23-
repo = "zfstools";
24-
tag = "v${finalAttrs.version}";
25-
hash = "sha256-z8umKWn8vUb2lLattbtSn4BCHD0W92hRvuL2uvrgm5o=";
16+
owner = "Mic92";
17+
repo = "zfstools-py";
18+
rev = "971770144309cf7f1d49316d1341396040992e1a";
19+
hash = "sha256-JYXqAlmZQUB5LVsSvQzjKDIQsz2oZgyOLOErTy8p4Bg=";
2620
};
2721

28-
buildInputs = [ rubyEnv.wrappedRuby ];
29-
nativeBuildInputs = [ makeWrapper ];
30-
31-
installPhase = ''
32-
mkdir -p $out/bin
33-
cp bin/* $out/bin/
22+
build-system = [ python3Packages.hatchling ];
3423

35-
cp -R lib $out/
24+
makeWrapperArgs = [
25+
"--prefix PATH : ${lib.makeBinPath [ (if stdenv.hostPlatform.isFreeBSD then freebsd.zfs else zfs) ]}"
26+
];
3627

37-
for f in $out/bin/*; do
38-
wrapProgram $f \
39-
--set RUBYLIB $out/lib \
40-
--prefix PATH : ${if stdenv.hostPlatform.isFreeBSD then freebsd.zfs else zfs}/bin
41-
done
42-
'';
28+
nativeCheckInputs = [ python3Packages.pytestCheckHook ];
4329

4430
meta = {
4531
description = "OpenSolaris-compatible auto-snapshotting script for ZFS";
46-
homepage = "https://github.com/bdrewery/zfstools";
47-
longDescription = ''
48-
zfstools is an OpenSolaris-like and compatible auto snapshotting script
49-
for ZFS, which also supports auto snapshotting mysql databases.
50-
'';
32+
homepage = "https://github.com/Mic92/zfstools-py";
5133
license = lib.licenses.bsd2;
34+
mainProgram = "zfs-auto-snapshot";
5235
platforms = lib.platforms.linux ++ lib.platforms.freebsd;
5336
};
54-
})
37+
}

0 commit comments

Comments
 (0)