depot/third_party/nixpkgs/pkgs/development/tools/fnlfmt/default.nix
Default email 24fdeddc0a Project import generated by Copybara.
GitOrigin-RevId: 2768c7d042a37de65bb1b5b3268fc987e534c49d
2024-10-23 09:41:50 +03:00

42 lines
1,001 B
Nix

{ lib, stdenv, fetchFromSourcehut, luaPackages, lua }:
stdenv.mkDerivation rec {
pname = "fnlfmt";
version = "0.3.2";
src = fetchFromSourcehut {
owner = "~technomancy";
repo = "fnlfmt";
rev = "refs/tags/${version}";
hash = "sha256-LYHhKC8iA4N8DdCH8GfSOkN/e+W3YjkFhVSDQraKoFk=";
};
nativeBuildInputs = [ luaPackages.fennel ];
buildInputs = [ lua ];
buildPhase = ''
runHook preBuild
echo "#!${lua}/bin/lua" > fnlfmt
${luaPackages.fennel}/bin/fennel --require-as-include --compile tags/${version}/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 ];
mainProgram = "fnlfmt";
};
}