nixpkgs/pkgs/development/tools/fnlfmt/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
969 B
Nix
Raw Normal View History

{ lib, stdenv, fetchFromSourcehut, luaPackages, lua }:
2021-08-04 14:36:51 +00:00
stdenv.mkDerivation rec {
pname = "fnlfmt";
2023-08-07 08:39:05 +00:00
version = "0.3.1";
2021-08-04 14:36:51 +00:00
src = fetchFromSourcehut {
owner = "~technomancy";
repo = pname;
rev = version;
2023-08-07 08:39:05 +00:00
sha256 = "sha256-rhbYG0TpqAZnbLaZOG739/pDA61Dwb4Y1HhBxWLtOus=";
2021-08-04 14:36:51 +00:00
};
nativeBuildInputs = [ luaPackages.fennel ];
2021-08-04 14:36:51 +00:00
buildInputs = [ lua ];
buildPhase = ''
runHook preBuild
echo "#!${lua}/bin/lua" > fnlfmt
${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;
maintainers = with maintainers; [ chiroptical ];
2023-08-07 15:08:52 +00:00
mainProgram = "fnlfmt";
2021-08-04 14:36:51 +00:00
};
}