From c3218e1ff70242566acd4e08b992d6a26b823bd7 Mon Sep 17 00:00:00 2001 From: figsoda Date: Sun, 13 Jun 2021 22:47:06 -0400 Subject: [PATCH] stylua: init at 0.8.1 --- pkgs/development/tools/stylua/default.nix | 35 +++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 37 insertions(+) create mode 100644 pkgs/development/tools/stylua/default.nix diff --git a/pkgs/development/tools/stylua/default.nix b/pkgs/development/tools/stylua/default.nix new file mode 100644 index 000000000000..56c57483ddc5 --- /dev/null +++ b/pkgs/development/tools/stylua/default.nix @@ -0,0 +1,35 @@ +{ fetchFromGitHub +, lib +, rustPlatform +, stdenvNoCC +, lua52Support ? true +, luauSupport ? false +}: + +rustPlatform.buildRustPackage rec { + pname = "stylua"; + version = "0.8.1"; + + src = fetchFromGitHub { + owner = "johnnymorganz"; + repo = pname; + rev = "v${version}"; + sha256 = "0gjm9pvwfbwhd49pm5sw5plwhlhvbfkms44h67zgvy7xzqv8h3dw"; + }; + + cargoSha256 = "117m78naldp6yvwcccvsrbnx6x6287cvq0saa06pmiqv1rqm50m3"; + + 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 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 453c4758ae4e..e0d49336a3e5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14002,6 +14002,8 @@ in strace = callPackage ../development/tools/misc/strace { }; + stylua = callPackage ../development/tools/stylua { }; + summon = callPackage ../development/tools/summon { }; svlint = callPackage ../development/tools/analysis/svlint { };