diff --git a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
index 7c088ae7b47e..0f1dffc798e7 100644
--- a/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
+++ b/nixos/doc/manual/from_md/release-notes/rl-2211.section.xml
@@ -563,6 +563,15 @@
option, and it is enabled by default, for servers.
+
+
+ stylua no longer accepts
+ lua52Support and
+ luauSupport overrides, use
+ features instead, which defaults to
+ [ "lua54" "luau" ].
+
+
diff --git a/nixos/doc/manual/release-notes/rl-2211.section.md b/nixos/doc/manual/release-notes/rl-2211.section.md
index 094f0cd80f26..7214937781d2 100644
--- a/nixos/doc/manual/release-notes/rl-2211.section.md
+++ b/nixos/doc/manual/release-notes/rl-2211.section.md
@@ -192,6 +192,8 @@ Available as [services.patroni](options.html#opt-services.patroni.enable).
- `k3s` supports `clusterInit` option, and it is enabled by default, for servers.
+- `stylua` no longer accepts `lua52Support` and `luauSupport` overrides, use `features` instead, which defaults to `[ "lua54" "luau" ]`.
+
## Other Notable Changes {#sec-release-22.11-notable-changes}
diff --git a/pkgs/development/tools/stylua/default.nix b/pkgs/development/tools/stylua/default.nix
index 383a6534671b..ffa548ec377e 100644
--- a/pkgs/development/tools/stylua/default.nix
+++ b/pkgs/development/tools/stylua/default.nix
@@ -1,34 +1,29 @@
-{ fetchFromGitHub
-, lib
+{ lib
, rustPlatform
-, lua52Support ? true
-, luauSupport ? false
-, fetchpatch
+, fetchFromGitHub
+ # lua54 implies lua52/lua53
+, features ? [ "lua54" "luau" ]
}:
rustPlatform.buildRustPackage rec {
pname = "stylua";
- version = "0.14.3";
+ version = "0.15.0";
src = fetchFromGitHub {
owner = "johnnymorganz";
repo = pname;
rev = "v${version}";
- sha256 = "sha256-l4q6Qlgdxgm4K5+NkWMZI3Hhtx6m/0DG9PE4gvo/ylo=";
+ sha256 = "sha256-x4/DmFi/6bIQVn8sfSFEOJIv4Zd/3oHKXbrd6yIsSYU=";
};
- cargoSha256 = "sha256-zlk9KdiSKWknyuJTTqpzCeSJUXJGDK2A0g1ss8AHoYs=";
+ cargoSha256 = "sha256-lY18so+uG3yri18zd29B479nl0l1C0F1mw+sPrccRQs=";
- cargoPatches = [
- # fixes broken 0.14.3 lockfile
- (fetchpatch {
- url = "https://github.com/JohnnyMorganz/StyLua/commit/834f632f67af6425e7773eaade8d23a880946843.patch";
- sha256 = "sha256-oM2gaILwiNMqTGFRQBw6/fxbjljNWxeIb0lcXcAJR3w=";
- })
- ];
+ # remove cargo config so it can find the linker on aarch64-unknown-linux-gnu
+ postPatch = ''
+ rm .cargo/config.toml
+ '';
- buildFeatures = lib.optional lua52Support "lua52"
- ++ lib.optional luauSupport "luau";
+ buildFeatures = features;
meta = with lib; {
description = "An opinionated Lua code formatter";