2023-08-14 23:39:46 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
2023-10-31 15:16:53 +00:00
|
|
|
, nix-update-script
|
2023-08-14 23:39:46 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "thud";
|
2023-10-29 22:12:08 +00:00
|
|
|
version = "0.3.1";
|
2023-08-14 23:39:46 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "donovanglover";
|
|
|
|
repo = "thud";
|
|
|
|
rev = version;
|
2023-10-29 22:12:08 +00:00
|
|
|
hash = "sha256-BmrJaZ1IKXjx4/QkBDZyXvTTaalfEOKsBp9ZCW8px7I=";
|
2023-08-14 23:39:46 +00:00
|
|
|
};
|
|
|
|
|
2023-10-29 22:12:08 +00:00
|
|
|
cargoHash = "sha256-rmVVdes7GuGV+ClqJGxNIrs7oSwe8/ZHFD6OfP/UW7A=";
|
2023-08-14 23:39:46 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
install -Dm644 assets/thud.thumbnailer $out/share/thumbnailers/thud.thumbnailer
|
|
|
|
substituteInPlace $out/share/thumbnailers/thud.thumbnailer --replace "thud" "$out/bin/thud"
|
|
|
|
|
2023-10-29 22:12:08 +00:00
|
|
|
installManPage target/man/thud.1
|
2023-08-14 23:39:46 +00:00
|
|
|
|
|
|
|
installShellCompletion --cmd thud \
|
2023-10-29 22:12:08 +00:00
|
|
|
--bash <(cat target/completions/thud.bash) \
|
|
|
|
--fish <(cat target/completions/thud.fish) \
|
|
|
|
--zsh <(cat target/completions/_thud)
|
2023-08-14 23:39:46 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-31 15:16:53 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2023-08-14 23:39:46 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Generate directory thumbnails for GTK-based file browsers from images inside them";
|
|
|
|
homepage = "https://github.com/donovanglover/thud";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ donovanglover ];
|
|
|
|
mainProgram = "thud";
|
|
|
|
};
|
|
|
|
}
|