nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 fetchCrate,
5 installShellFiles,
6 stdenv,
7}:
8
9rustPlatform.buildRustPackage rec {
10 pname = "planus";
11 version = "1.1.1";
12
13 src = fetchCrate {
14 pname = "planus-cli";
15 inherit version;
16 hash = "sha256-Tulp2gD4CbNaxRAc+7/rWY4SjXp66Kui9/PuKfnaeMs=";
17 };
18
19 cargoHash = "sha256-3wZ6kmWzGjS2pnBDBi3t2A9kSlWUyG5ohsGfK2ViTcY=";
20
21 nativeBuildInputs = [
22 installShellFiles
23 ];
24
25 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
26 installShellCompletion --cmd planus \
27 --bash <($out/bin/planus generate-completions bash) \
28 --fish <($out/bin/planus generate-completions fish) \
29 --zsh <($out/bin/planus generate-completions zsh)
30 '';
31
32 meta = {
33 description = "Alternative compiler for flatbuffers";
34 mainProgram = "planus";
35 homepage = "https://github.com/planus-org/planus";
36 changelog = "https://github.com/planus-org/planus/blob/v${version}/CHANGELOG.md";
37 license = with lib.licenses; [
38 asl20
39 mit
40 ];
41 maintainers = with lib.maintainers; [ figsoda ];
42 };
43}