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-04-21 15:54:59 +00:00
|
|
|
version = "1.8.0";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
src = fetchCrate {
|
|
|
|
inherit pname version;
|
|
|
|
hash = "sha256-+xbHw1DpFmapjsFoUvxUqTok8TKMebMw3gYjO/rx/iU=";
|
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-04-21 15:54:59 +00:00
|
|
|
cargoHash = "sha256-iuLhDcii+wXDNUsUMo8lj4kfJve5RAz7FT5Pxs9yFPQ=";
|
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
|
|
|
};
|
|
|
|
}
|