3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/stylua/default.nix
2021-06-17 11:20:56 -04:00

36 lines
933 B
Nix

{ fetchFromGitHub
, lib
, rustPlatform
, stdenvNoCC
, lua52Support ? true
, luauSupport ? false
}:
rustPlatform.buildRustPackage rec {
pname = "stylua";
version = "0.9.1";
src = fetchFromGitHub {
owner = "johnnymorganz";
repo = pname;
rev = "v${version}";
sha256 = "1p6k5al8vvafz2w4z27jnyw8w2cp316h70dlx40ir4c3lk511n2j";
};
cargoSha256 = "0ssfny11pv2b4zz7lh28cv603slp54pbcgj18y9k7b6jjajrz67q";
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 ];
};
}