nixpkgs/pkgs/tools/misc/vrc-get/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1.4 KiB
Nix
Raw Normal View History

{ fetchCrate, installShellFiles, lib, rustPlatform, pkg-config, stdenv, Security, SystemConfiguration, buildPackages }:
2023-07-11 14:16:37 +01:00
rustPlatform.buildRustPackage rec {
pname = "vrc-get";
2024-05-13 15:08:10 +01:00
version = "1.8.1";
2023-07-11 14:16:37 +01:00
2024-04-07 09:23:48 +01:00
src = fetchCrate {
inherit pname version;
2024-05-13 15:08:10 +01:00
hash = "sha256-j8B7g/w1Qtiuj099RlRLmrYTFiE7d2vVg/nTbaa8pRU=";
2023-07-11 14:16:37 +01:00
};
nativeBuildInputs = [ installShellFiles pkg-config ];
2023-07-11 14:16:37 +01:00
2024-04-07 09:23:48 +01:00
buildInputs = lib.optionals stdenv.isDarwin [ Security SystemConfiguration ];
2023-07-11 14:16:37 +01:00
2024-05-13 15:08:10 +01:00
cargoHash = "sha256-WFGY5osZIEYeHQchvuE3ddeqh2wzfZNV+SGqW08zYDI=";
2023-07-11 14:16:37 +01: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-11 14:16:37 +01:00
meta = with lib; {
description = "Command line client of VRChat Package Manager, the main feature of VRChat Creator Companion (VCC)";
2024-04-07 09:23:48 +01:00
homepage = "https://github.com/vrc-get/vrc-get";
2023-07-11 14:16:37 +01:00
license = licenses.mit;
maintainers = with maintainers; [ bddvlpr ];
2023-11-27 01:17:53 +00:00
mainProgram = "vrc-get";
2023-07-11 14:16:37 +01:00
};
}