diff --git a/pkgs/tools/backup/zfs-prune-snapshots/default.nix b/pkgs/tools/backup/zfs-prune-snapshots/default.nix new file mode 100644 index 000000000000..434c86b343a8 --- /dev/null +++ b/pkgs/tools/backup/zfs-prune-snapshots/default.nix @@ -0,0 +1,30 @@ +{ stdenv, fetchFromGitHub, go-md2man }: + +stdenv.mkDerivation rec { + version = "1.1.0"; + pname = "zfs-prune-snapshots"; + + src = fetchFromGitHub { + owner = "bahamas10"; + repo = pname; + rev = "v${version}"; + sha256 = "09dz9v6m47dxfvfncz0k926dqfhagm87kd33dcw66cbw15ac3spx"; + }; + + nativeBuildInputs = [ go-md2man ]; + + makeTargets = [ "man" ]; + + installPhase = '' + install -m 755 -D zfs-prune-snapshots $out/bin/zfs-prune-snapshots + install -m 644 -D man/zfs-prune-snapshots.1 $out/share/man/man1/zfs-prune-snapshots.1 + ''; + + meta = with stdenv.lib; { + description = "Remove snapshots from one or more zpools that match given criteria"; + homepage = "https://github.com/bahamas10/zfs-prune-snapshots"; + license = licenses.mit; + maintainers = [ maintainers.ymarkus ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7dbfbcf1cfb7..e6d9578b9c52 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -27333,6 +27333,8 @@ in kube3d = callPackage ../applications/networking/cluster/kube3d {}; + zfs-prune-snapshots = callPackage ../tools/backup/zfs-prune-snapshots {}; + zfs-replicate = python3Packages.callPackage ../tools/backup/zfs-replicate { }; runwayml = callPackage ../applications/graphics/runwayml {};