From 72789984ce76c25bd7bd59eb41fb00036a1815fd Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Tue, 23 Apr 2024 22:41:38 +0100 Subject: [PATCH] add lualinux package --- pkgs/default.nix | 1 + pkgs/lualinux/default.nix | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 pkgs/lualinux/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 3d5d59f..946df60 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -71,6 +71,7 @@ in { levitate = callPackage ./levitate {}; libubootenv = callPackage ./libubootenv {}; linotify = callPackage ./linotify {}; + lualinux = callPackage ./lualinux {}; # we need to build real lzma instead of using xz, because the lzma # decoder in u-boot doesn't understand streaming lzma archives diff --git a/pkgs/lualinux/default.nix b/pkgs/lualinux/default.nix new file mode 100644 index 0000000..62be57a --- /dev/null +++ b/pkgs/lualinux/default.nix @@ -0,0 +1,22 @@ +{ lua, lib, fetchFromGitHub }: +let + pname = "lualinux"; + src = fetchFromGitHub { + repo = "lualinux"; + owner = "philanc"; + rev = "1d4c962aad9cbe01c05df741b91e8b39c356362c"; + hash = "sha256-+Ys4sERG+TI8nRzG38UP+KqbH0efspaX0j4IHCt56RI="; + }; +in lua.pkgs.buildLuaPackage { + inherit pname; + version = "0.1"; # :shrug: + + inherit src; + makeFlags = [ "LUADIR=." "lualinux.so" ]; + + installPhase = '' + mkdir -p "$out/lib/lua/${lua.luaversion}" + cp ${pname}.so "$out/lib/lua/${lua.luaversion}/" + ''; + +}