nixpkgs/pkgs/by-name/zf/zfs-prune-snapshots/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

32 lines
875 B
Nix

{ lib, stdenv, fetchFromGitHub, go-md2man }:
stdenv.mkDerivation rec {
version = "1.5.0";
pname = "zfs-prune-snapshots";
src = fetchFromGitHub {
owner = "bahamas10";
repo = pname;
rev = "v${version}";
sha256 = "sha256-gCf/ZIeIh84WQNs5wZO1/l3zpnl2sNxsFO7cOa92JUM=";
};
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 lib; {
description = "Remove snapshots from one or more zpools that match given criteria";
mainProgram = "zfs-prune-snapshots";
homepage = "https://github.com/bahamas10/zfs-prune-snapshots";
license = licenses.mit;
maintainers = [ maintainers.ymarkus ];
platforms = platforms.all;
};
}