Files
liminix/pkgs/logshippers/default.nix
Daniel Barlow af6e41db7a logshippers: add victorialogsend script
it's only very lightly tested but it seems to work.  the _stream
may be quite wrong, or perhaps that's a local admin decision anyway
2025-10-08 20:10:11 +01:00

42 lines
794 B
Nix

{
fetchurl,
writeFennel,
fennel,
fennelrepl,
runCommand,
lua,
anoia,
lualinux,
stdenv,
}:
let
name = "logshippers";
luafy = name : source :
writeFennel name {
packages = [ anoia lualinux fennel ];
macros = [ anoia.dev ];
mainFunction = "run";
} source;
incz = luafy name ./incz.fnl;
victorialogsend = luafy name ./victorialogsend.fnl;
in
stdenv.mkDerivation {
inherit name;
src = ./.;
buildInputs = [ lua ];
nativeBuildInputs = [ fennelrepl ];
buildPhase = ''
fennelrepl --test ./incz.fnl
fennelrepl --test ./victorialogsend.fnl
cp -p ${incz} incz
cp -p ${victorialogsend} victorialogsend
'';
installPhase = ''
install -D incz $out/bin/incz
install -D victorialogsend $out/bin/victorialogsend
'';
}