From 3b5172eae14225cc27bb7492a32d7055ba534e8d Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Wed, 4 Aug 2021 08:36:51 -0600 Subject: [PATCH] fnlfmt: init --- pkgs/development/tools/fnlfmt/default.nix | 41 +++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 43 insertions(+) create mode 100644 pkgs/development/tools/fnlfmt/default.nix diff --git a/pkgs/development/tools/fnlfmt/default.nix b/pkgs/development/tools/fnlfmt/default.nix new file mode 100644 index 000000000000..4333706d1cf3 --- /dev/null +++ b/pkgs/development/tools/fnlfmt/default.nix @@ -0,0 +1,41 @@ +{ lib, stdenv, fetchFromSourcehut, fennel, lua }: + +stdenv.mkDerivation rec { + pname = "fnlfmt"; + version = "0.2.1"; + + src = fetchFromSourcehut { + owner = "~technomancy"; + repo = pname; + rev = version; + sha256 = "sha256-JIqeQhI3fFGrej2wbj6/367IZqWAFegySc2R8IDmvGE="; + }; + + 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 = [ maintainers.gpanders ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 412985e644a5..18a88d1185b5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10891,6 +10891,8 @@ in recurseIntoAttrs (callPackage ../development/compilers/flutter { }); flutter = flutterPackages.stable; + fnlfmt = callPackage ../development/tools/fnlfmt { }; + fpc = callPackage ../development/compilers/fpc { }; g203-led = callPackage ../tools/misc/g203-led { };