depot/third_party/nixpkgs/pkgs/development/tools/fnlfmt/default.nix
Default email a3bb8d7922 Project import generated by Copybara.
GitOrigin-RevId: 439b1605227b8adb1357b55ce8529d541abbe9eb
2021-08-06 00:33:18 +03:00

41 lines
903 B
Nix

{ lib, stdenv, fetchFromSourcehut, fennel, lua }:
stdenv.mkDerivation rec {
pname = "fnlfmt";
version = "0.2.1";
src = fetchFromSourcehut {
owner = "~technomancy";
repo = pname;
rev = version;
sha256 = "sha256-JIqeQhI3fFGrej2wbj6/367IZqWAFegySc2R8IDmvGE=";
};
nativeBuildInputs = [ fennel ];
buildInputs = [ lua ];
buildPhase = ''
runHook preBuild
echo "#!${lua}/bin/lua" > fnlfmt
${fennel}/bin/fennel --require-as-include --compile cli.fnl >> fnlfmt
chmod +x fnlfmt
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -D ./fnlfmt $out/bin/fnlfmt
runHook postInstall
'';
meta = with lib; {
description = "Formatter for Fennel";
homepage = "https://git.sr.ht/~technomancy/fnlfmt";
license = licenses.lgpl3Plus;
platforms = lua.meta.platforms;
maintainers = [ maintainers.gpanders ];
};
}