depot/pkgs/by-name/ht/httm/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

49 lines
1.1 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
installShellFiles,
}:
rustPlatform.buildRustPackage rec {
pname = "httm";
version = "0.43.2";
src = fetchFromGitHub {
owner = "kimono-koans";
repo = pname;
rev = version;
hash = "sha256-8oG40pxhWd2MRxUSzZ3lgcsC9M1W5yBUZ0t5tO3B86U=";
};
cargoHash = "sha256-KKvpI3U6/cByP5M2ZiNtVrYyh2Nqe9cee2ObKqRBEyg=";
nativeBuildInputs = [ installShellFiles ];
postPatch = ''
chmod +x scripts/*.bash
patchShebangs scripts/*.bash
'';
postInstall = ''
installManPage httm.1
installShellCompletion --cmd httm \
--zsh scripts/httm-key-bindings.zsh
for script in scripts/*.bash; do
install -Dm755 "$script" "$out/bin/$(basename "$script" .bash)"
done
install -Dm644 README.md $out/share/doc/README.md
'';
meta = with lib; {
description = "Interactive, file-level Time Machine-like tool for ZFS/btrfs";
homepage = "https://github.com/kimono-koans/httm";
changelog = "https://github.com/kimono-koans/httm/releases/tag/${version}";
license = licenses.mpl20;
maintainers = with maintainers; [ wyndon ];
mainProgram = "httm";
};
}