lutgen: add shell completions

This commit is contained in:
Donovan Glover 2024-01-02 19:58:57 -05:00
parent c371bd90f0
commit 462e54e893
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -1,6 +1,8 @@
{ lib
, fetchFromGitHub
, rustPlatform
, stdenv
, installShellFiles
}:
rustPlatform.buildRustPackage rec {
@ -16,6 +18,17 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-DiorrgTH9lIdmaZL7451uCXj9X7M6eHf4MQc85MpU7s=";
nativeBuildInputs = [
installShellFiles
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd lutgen \
--bash <($out/bin/lutgen completions bash) \
--fish <($out/bin/lutgen completions fish) \
--zsh <($out/bin/lutgen completions zsh)
'';
meta = with lib; {
description = "A blazingly fast interpolated LUT generator and applicator for arbitrary and popular color palettes";
homepage = "https://github.com/ozwaldorf/lutgen-rs";