Do you know about pkg-config --cflags?
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
pkg-config
clang
wlroots_0_19
];
};
pkg-config --cflags wlroots-0.19 outputs -I/nix/store/pkg-hash-wlroots-0.19.0/include/wlroots-0.19
clang your-file.c $(pkg-config --cflags wlroots-0.19) should resolve #include <wlr/backend.h>
pkgs.symlinkJoin might help:
You might also want to define plugins in separate files: