depot/third_party/nixpkgs/pkgs/development/tools/fnlfmt/default.nix
Default email 02cf88bb76 Project import generated by Copybara.
GitOrigin-RevId: c4a0efdd5a728e20791b8d8d2f26f90ac228ee8d
2022-08-12 15:06:08 +03:00

41 lines
912 B
Nix

{ lib, stdenv, fetchFromSourcehut, fennel, lua }:
stdenv.mkDerivation rec {
pname = "fnlfmt";
version = "0.2.3";
src = fetchFromSourcehut {
owner = "~technomancy";
repo = pname;
rev = version;
sha256 = "sha256-FKmr5Xihyk+ikYN8WXBq5UFJziwEb8xaUBswNt/JMBg=";
};
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 = with maintainers; [ chiroptical ];
};
}