2022-09-13 19:55:15 +00:00
|
|
|
with import <nixpkgs> {};
|
|
|
|
let lua = lua5_3.withPackages (ps: [
|
|
|
|
ps.dkjson
|
|
|
|
ps.lpeg
|
|
|
|
ps.http
|
|
|
|
ps.luaposix
|
|
|
|
]);
|
2022-09-15 21:08:06 +00:00
|
|
|
inherit makeWrapper;
|
|
|
|
fennel = pkgs.fennel.override { inherit lua; };
|
2022-09-13 19:55:15 +00:00
|
|
|
in stdenv.mkDerivation {
|
|
|
|
pname = "grafana-sms-alert";
|
|
|
|
version = "0.1";
|
|
|
|
src = ./.;
|
2022-09-15 21:08:06 +00:00
|
|
|
makeFlags = [ "TARGET=${placeholder "out"}" ];
|
|
|
|
postInstall = ''
|
|
|
|
lua_path="`lua -e 'print(package.path)'`"
|
|
|
|
lua_cpath="`lua -e 'print(package.cpath)'`"
|
|
|
|
|
|
|
|
makeWrapper ${fennel}/bin/fennel $out/bin/grafana-sms-alert \
|
|
|
|
--add-flags "$out/lib/main.fnl"
|
|
|
|
'';
|
|
|
|
buildInputs = [lua fennel];
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2022-09-13 19:55:15 +00:00
|
|
|
}
|