Skip to content

Commit

Permalink
TODO complete overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
teto committed Jan 22, 2024
1 parent e9a7363 commit a9146e0
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 12 deletions.
8 changes: 5 additions & 3 deletions contrib/luarocks-packages.csv
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
name,src,ref,server,version,luaversion,maintainers
ansicolors,,,,,,
bcrypt,,,,,,
cloud_storage,,,,,,
date,,,,,,
etlua,,,,,,
lapis,,,,,,
lapis-console,,,,,5.1,
lapis-exceptions,,,,,5.1,
pgmoon,,,,,,
tableshape,,,,,,
lzlib,,,,,5.1,
mailgun,,,,,,
cloud_storage,,,,,,
mimetypes,,,,,,
struct,,,,,5.1,
pgmoon,,,,,,
tableshape,,,,,,
57 changes: 48 additions & 9 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,48 @@
overlays = [ self.overlays.default ];
};

# TODO fix in the overlay directly
mylzlib = pkgs.lua5_1.pkgs.lzlib.overrideAttrs(oa: {
# buildInputs = oa.buildInputs ++ [
# pkgs.zlib.dev
# pkgs.zlib.out
# ];
externalDeps = [
{ name = "ZLIB"; dep = pkgs.zlib; }
];
# extraVariables = rec {
# ZLIB_INCDIR = "${readline.dev}/include";
# # { name = "ZLIB"; dep = pkgs.zlib; }
# };

});

# myStruct =
# # else we get 'unpacker appears to have produced no directories'
# sourceRoot = ".";

# openresty uses luajit so we need lua5.1
luaEnv = pkgs.lua5_1.withPackages (lp: [
lp.luaexpat
lp.busted
luaEnv = pkgs.lua5_1.withPackages (lp: let

in [
lp.bcrypt
lp.luarocks
lp.moonscript # provides moonc compiler
lp.busted
lp.cloud_storage
lp.lapis
lp.lapis-console
lp.lapis-exceptions
lp.tableshape
lp.luaexpat
lp.luarocks
lp.mailgun
lp.cloud_storage
lp.moonscript # provides moonc compiler
lp.tableshape
lp.struct
mylzlib
# cloudstorage / zipwriter

]);

lua = pkgs.lua5_1;
in
{

Expand Down Expand Up @@ -74,7 +99,7 @@
# we should be able to do better
shellHook =
let
luarocksContent = pkgs.lua.pkgs.luaLib.generateLuarocksConfig {
luarocksContent = lua.pkgs.luaLib.generateLuarocksConfig {

externalDeps = [
{ name = "EXPAT"; dep = pkgs.expat; }
Expand Down Expand Up @@ -107,6 +132,11 @@
# if your pgsql server is configured via TCP
export PGHOST=localhost
# Probably a fault in our lua infra
export LUA_PATH="share/lua/${lua.luaversion}/?.lua;;"
export LUA_CPATH="share/lua/${lua.luaversion}/?.lua;;"
echo ${mylzlib.configFile}
'';

};
Expand All @@ -117,10 +147,19 @@
let
lua =
let
packageOverrides = prev.callPackage ./contrib/generated-packages.nix {
# TODO

generatedOverrides = prev.callPackage ./contrib/generated-packages.nix {
# as done in nixpkgs
inherit (lua.pkgs) callPackage;
};

packageOverrides = final: prev: let pkgs = (generatedOverrides final prev) ;
in final: prev: {
struct = pkgs = ;


};
in
(prev.lua5_1.override { inherit packageOverrides; self = lua; });
in
Expand Down

0 comments on commit a9146e0

Please sign in to comment.