2021-08-04 16:36:51 +02:00
|
|
|
{ lib, stdenv, fetchFromSourcehut, fennel, lua }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "fnlfmt";
|
2021-10-03 23:03:49 +02:00
|
|
|
version = "0.2.2";
|
2021-08-04 16:36:51 +02:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~technomancy";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-10-03 23:03:49 +02:00
|
|
|
sha256 = "sha256-ZuSXeAhxfH0F/Y0nwqisxLMwh21Kub7viNcXD3FVYOc=";
|
2021-08-04 16:36:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
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;
|
2021-10-03 23:03:49 +02:00
|
|
|
maintainers = with maintainers; [ gpanders chiroptical ];
|
2021-08-04 16:36:51 +02:00
|
|
|
};
|
|
|
|
}
|