sizelint: add shell completions

This commit is contained in:
a-kenji
2026-03-05 20:34:04 +01:00
parent 6d42a47c01
commit 82211fa0d3
+11
View File
@@ -1,7 +1,9 @@
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
installShellFiles,
git,
}:
@@ -16,10 +18,19 @@ rustPlatform.buildRustPackage (finalAttrs: {
hash = "sha256-1k1+7fVWhflEKyhOlb7kMn2xqeAM6Y5N9uHtOJvVn4A=";
};
nativeBuildInputs = [ installShellFiles ];
nativeCheckInputs = [ git ];
cargoHash = "sha256-Z+pmlp/0LlKfc4QLosePw7TdLFYe6AnAVOJSw2DzlfI=";
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd sizelint \
--bash <($out/bin/sizelint completions bash) \
--fish <($out/bin/sizelint completions fish) \
--zsh <($out/bin/sizelint completions zsh)
'';
meta = {
description = "Lint your file tree based on file sizes";
homepage = "https://github.com/a-kenji/sizelint";