-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
38 lines (34 loc) · 1.06 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
{
craneLib,
installShellFiles,
stdenv,
buildPackages,
lib,
}: let
commonArgs = {
src = craneLib.cleanCargoSource ./.;
strictDeps = true;
doCheck = false;
nativeBuildInputs = [installShellFiles];
inherit (craneLib.crateNameFromCargoToml {src = ./crates/unitypkg-cli;}) pname version;
postInstall = let
unitypkg-cli = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/unitypkg-cli";
in
lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ''
installShellCompletion --cmd unitypkg-cli \
--bash <(${unitypkg-cli} completions bash) \
--fish <(${unitypkg-cli} completions fish) \
--zsh <(${unitypkg-cli} completions zsh)
'';
};
in
craneLib.buildPackage (commonArgs
// {
meta = with lib; {
description = "Manipulate Unity's portable package files";
homepage = "https://github.com/bddvlpr/unitypkg";
license = licenses.mit;
maintainers = with maintainers; [bddvlpr];
mainProgram = "unitypkg-cli";
};
})