2023-10-09 19:29:22 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, installShellFiles
|
|
|
|
, pkg-config
|
|
|
|
, libwebp
|
2023-08-04 22:07:22 +00:00
|
|
|
}:
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
rustPlatform.buildRustPackage {
|
2023-08-04 22:07:22 +00:00
|
|
|
pname = "catppuccin-catwalk";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.1.0";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "catppuccin";
|
|
|
|
repo = "toolbox";
|
|
|
|
rev = "b38153e94622bab574224bb24a6ae953b3a849da";
|
|
|
|
hash = "sha256-zZRl6Xem41pBQmEoK24YR4TKiQ84nU5phBih2TF8G8g=";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
buildAndTestSubdir = "catwalk";
|
|
|
|
cargoHash = "sha256-KoxivYLzJEjWbxIkizrMpmVwUF7bfVxl13H774lzQRg=";
|
2023-08-10 07:59:29 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles pkg-config ];
|
|
|
|
buildInputs = [ libwebp ];
|
2023-08-04 22:07:22 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd catwalk \
|
|
|
|
--bash <("$out/bin/catwalk" completion bash) \
|
|
|
|
--zsh <("$out/bin/catwalk" completion zsh) \
|
|
|
|
--fish <("$out/bin/catwalk" completion fish)
|
|
|
|
'';
|
2023-08-04 22:07:22 +00:00
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
doInstallCheck = !stdenv.hostPlatform.isStatic &&
|
|
|
|
stdenv.hostPlatform.parsed.kernel.execFormat == lib.systems.parse.execFormats.elf;
|
|
|
|
installCheckPhase = ''
|
|
|
|
runHook preInstallCheck
|
|
|
|
readelf -a $out/bin/catwalk | grep -F 'Shared library: [libwebp.so'
|
|
|
|
runHook postInstallCheck
|
|
|
|
'';
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2023-10-09 19:29:22 +00:00
|
|
|
homepage = "https://github.com/catppuccin/toolbox/tree/main/catwalk";
|
2023-08-04 22:07:22 +00:00
|
|
|
description = "A CLI for Catppuccin that takes in four showcase images and displays them all at once";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ ryanccn ];
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "catwalk";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
}
|