2024-05-15 15:35:15 +00:00
|
|
|
{ fetchCrate, installShellFiles, lib, rustPlatform, pkg-config, stdenv, Security, SystemConfiguration, buildPackages }:
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "vrc-get";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "1.8.1";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
src = fetchCrate {
|
|
|
|
inherit pname version;
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-j8B7g/w1Qtiuj099RlRLmrYTFiE7d2vVg/nTbaa8pRU=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles pkg-config ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [ Security SystemConfiguration ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
cargoHash = "sha256-WFGY5osZIEYeHQchvuE3ddeqh2wzfZNV+SGqW08zYDI=";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
# Execute the resulting binary to generate shell completions, using emulation if necessary when cross-compiling.
|
|
|
|
# If no emulator is available, then give up on generating shell completions
|
|
|
|
postInstall =
|
|
|
|
let
|
|
|
|
vrc-get = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/vrc-get";
|
|
|
|
in
|
|
|
|
lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ''
|
|
|
|
installShellCompletion --cmd vrc-get \
|
|
|
|
--bash <(${vrc-get} completion bash) \
|
|
|
|
--fish <(${vrc-get} completion fish) \
|
|
|
|
--zsh <(${vrc-get} completion zsh)
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Command line client of VRChat Package Manager, the main feature of VRChat Creator Companion (VCC)";
|
2024-04-21 15:54:59 +00:00
|
|
|
homepage = "https://github.com/vrc-get/vrc-get";
|
2023-07-15 17:15:38 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ bddvlpr ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "vrc-get";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
}
|