81d9b81b06
This uses Nix to inject the path to the syntax highlighting assets that ship with the bat source code into the cheddar build at compile time, where the Rust compiler then inserts it into the binary via macros. bat has a lot of custom syntax highlighting definitions that they collected from all over the place (including for languages like Nix!) and this makes them accessible to cheddar. Also if you're reading this, can you just take a moment to appreciate how incredible it is that Nix just lets us do something like this?!
20 lines
525 B
Nix
20 lines
525 B
Nix
{ pkgs, ... }:
|
|
|
|
with pkgs.third_party;
|
|
|
|
naersk.buildPackage {
|
|
src = ./.;
|
|
doDoc = false;
|
|
doCheck = false;
|
|
|
|
override = x: {
|
|
# bat contains syntax highlighting packages for a lot more
|
|
# languages than what ships with syntect, and we can make use of
|
|
# them!
|
|
BAT_SYNTAXES = "${bat.src}/assets/syntaxes.bin";
|
|
|
|
# LLVM packages (why are they even required?) are not found
|
|
# automatically if added to buildInputs, hence this ...
|
|
LIBCLANG_PATH = "${llvmPackages.libclang}/lib/libclang.so.7";
|
|
};
|
|
}
|