{ lib, rustPlatform, fetchFromGitHub, # lua54 implies lua52/lua53 features ? [ "lua54" "luajit" "luau" ], }: rustPlatform.buildRustPackage rec { pname = "stylua"; version = "2.3.0"; src = fetchFromGitHub { owner = "johnnymorganz"; repo = "stylua"; rev = "v${version}"; sha256 = "sha256-iyZ30Gc32TQsQyMLwArfIRtM0NkbXkqmca46nI0526M="; }; cargoHash = "sha256-H50/e/XyFvXHhwrKUbKZFZwSHfwAkAtddEvFiOr5220="; # remove cargo config so it can find the linker on aarch64-unknown-linux-gnu postPatch = '' rm .cargo/config.toml ''; buildFeatures = features; meta = { description = "Opinionated Lua code formatter"; homepage = "https://github.com/johnnymorganz/stylua"; changelog = "https://github.com/johnnymorganz/stylua/blob/v${version}/CHANGELOG.md"; license = lib.licenses.mpl20; maintainers = with lib.maintainers; [ figsoda ]; mainProgram = "stylua"; }; }