2022-09-25 01:15:54 +00:00
|
|
|
{ lib, stdenv, fetchFromSourcehut, luaPackages, lua }:
|
2021-08-04 14:36:51 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "fnlfmt";
|
2023-02-28 20:38:03 +00:00
|
|
|
version = "0.3.0";
|
2021-08-04 14:36:51 +00:00
|
|
|
|
|
|
|
src = fetchFromSourcehut {
|
|
|
|
owner = "~technomancy";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-02-28 20:38:03 +00:00
|
|
|
sha256 = "sha256-Q7nQjmEHwdu3qRdLK68aKg7es5okVz9FCoR7INzh/xk=";
|
2021-08-04 14:36:51 +00:00
|
|
|
};
|
|
|
|
|
2022-09-25 01:15:54 +00:00
|
|
|
nativeBuildInputs = [ luaPackages.fennel ];
|
2021-08-04 14:36:51 +00:00
|
|
|
|
|
|
|
buildInputs = [ lua ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
echo "#!${lua}/bin/lua" > fnlfmt
|
2022-09-25 01:15:54 +00:00
|
|
|
${luaPackages.fennel}/bin/fennel --require-as-include --compile cli.fnl >> fnlfmt
|
2021-08-04 14:36:51 +00:00
|
|
|
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;
|
2022-07-07 13:20:05 +00:00
|
|
|
maintainers = with maintainers; [ chiroptical ];
|
2021-08-04 14:36:51 +00:00
|
|
|
};
|
|
|
|
}
|