#──────────────────────────────────────────────────────────────────────────────┐
# SPDX-FileCopyrightText: 2026 toastal <https://toast.al/contact/>             │
# SPDX-License-Identifier: MPL-2.0                                             │
#──────────────────────────────────────────────────────────────────────────────┘
{
   lib,
   runCommand,
   ocamlformat,
}:

runCommand "extract-ocamlformat-rpc-bin"
   {
      meta.description = ''
         I don’t like ocamlformat as it doesn’t have tab support despite OCaml
         fully supporting tabs — so I use Topiary. However, the OCaml LSP
         requires ocamlformat’s RPC bin specificially.
      '';
   }
   ''
      mkdir -p $out/bin
      cp ${lib.getBin ocamlformat}/bin/ocamlformat-rpc $out/bin/
   ''
