Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
947 B
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
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";
};
}