3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/stylua/default.nix

36 lines
933 B
Nix
Raw Normal View History

2021-06-14 03:47:06 +01:00
{ fetchFromGitHub
, lib
, rustPlatform
, stdenvNoCC
, lua52Support ? true
, luauSupport ? false
}:
rustPlatform.buildRustPackage rec {
pname = "stylua";
2021-06-15 18:50:48 +01:00
version = "0.9.0";
2021-06-14 03:47:06 +01:00
src = fetchFromGitHub {
owner = "johnnymorganz";
repo = pname;
rev = "v${version}";
2021-06-15 18:50:48 +01:00
sha256 = "0ihb6hq1va6nj7d2883m9gdhzrwmcsw7z0fxqkhs9scv4i9x6s9d";
2021-06-14 03:47:06 +01:00
};
2021-06-15 18:50:48 +01:00
cargoSha256 = "04gm9drb4qh1sdzqqdj3lwb462y22sz24gjr6nw3sd2a0iqhsknf";
2021-06-14 03:47:06 +01:00
cargoBuildFlags = lib.optionals lua52Support [ "--features" "lua52" ]
++ lib.optionals luauSupport [ "--features" "luau" ];
# test_standard fails on darwin
doCheck = !stdenvNoCC.isDarwin;
meta = with lib; {
description = "An opinionated Lua code formatter";
homepage = "https://github.com/johnnymorganz/stylua";
changelog = "https://github.com/johnnymorganz/stylua/blob/v${version}/CHANGELOG.md";
license = licenses.mpl20;
maintainers = with maintainers; [ figsoda ];
};
}