Cannot declare and install a Luarocks library

I am building a home-manager configuration, and I’m trying to install Lua with a luarocks library called jeejah. Sadly this library isn’t on lua53Packages, so I’ve came up with the following:

{ pkgs, ... }:

{
  home.packages = with pkgs;
    [
      wget
      curl
      (lua5_3_compat.withPackages (ps:
        with ps; [
          fennel
          luafilesystem
          readline
          luasocket
          (lua5_3.pkgs.buildLuarocksPackage {
            pname = "jeejah";
            lua = lua5_3;
            version = "0.3.2-1";
            knownRockspec = (pkgs.fetchurl {
              url = "https://luarocks.org/jeejah-0.3.2-1.rockspec";
              sha256 = "sha256-Ouj+umHFOLtGwwMKochvG1fqIyRMdPzXg9039jD/bPk=";
            }).outPath;
            disabled = luaOlder "5.1";
            src = fetchFromGitLab {
              owner = "technomancy";
              repo = "jeejah";
              rev = "1555350e1e5eb77625334db1fba3c79b8c2c30a2";
              sha256 = "sha256-DyJJprTj9WjnhCC5CqudObLuae43zJD0VY9svGbqz10=";
            };
            propagatedBuildInputs = [ luasocket ];
            meta = { };
          })
        ]))
    ];
}

However, running home-manager switch complains with the following:

% home-manager switch
these 9 derivations will be built:
  /nix/store/yqg0fkfdsxyfw1h6xbd3sdy817cj1565-lua5.3-jeejah-0.3.2-1.drv
  /nix/store/mm0wmy5xz104b69k30mzzjifwrqfps88-lua-5.3.6-env.drv
  /nix/store/9cy388h84my69xi8554d51i05kcp7xlb-home-manager-applications.drv
  /nix/store/xjifp5166kkpwq584mqngdgychf1lwli-home-manager-fonts.drv
  /nix/store/vqc9rnjdmmjv55am90fhr7crrfn8anp6-hm_LibraryFonts.homemanagerfontsversion.drv
  /nix/store/78k4kknh66j2rpbc29nyrk9f18fi1pwy-home-manager-files.drv
  /nix/store/xlx7a5sic4cl98nr1fl23dljs8ihi423-home-manager-path.drv
  /nix/store/h4mk597zyvism6fapiy9pmn7by66awsj-activation-script.drv
  /nix/store/sqkcaqq79i6yifxaj34zs0z8mgyjnman-home-manager-generation.drv
building '/nix/store/yqg0fkfdsxyfw1h6xbd3sdy817cj1565-lua5.3-jeejah-0.3.2-1.drv'...
structuredAttrs is enabled
Running phase: unpackPhase
unpacking source archive /nix/store/srxs858law6s8is9hk1xssvwgp2i6nqa-source
source root is source
Running phase: patchPhase
Running phase: configurePhase
Running phase: buildPhase
Running phase: installPhase
Missing dependencies for jeejah 0.3.2-1:
   luasocket 3.0rc1-2 (not installed)

jeejah 0.3.2-1 depends on lua >= 5.1 (5.3-1 provided by VM: success)
jeejah 0.3.2-1 depends on luasocket 3.0rc1-2 (not installed)
Warning: Failed searching manifest: Failed downloading https://luarocks.org/manifest-5.3 - no downloader tool available, please install wget or curl in your system
Warning: Failed searching manifest: Failed downloading https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/manifest-5.3 - no downloader tool available, please install wget or curl in your system
Warning: Failed searching manifest: Failed downloading https://loadk.com/luarocks/manifest-5.3 - no downloader tool available, please install wget or curl in your system

Error: Could not satisfy dependency luasocket 3.0rc1-2: No results matching query were found for Lua 5.3.
error: builder for '/nix/store/yqg0fkfdsxyfw1h6xbd3sdy817cj1565-lua5.3-jeejah-0.3.2-1.drv' failed with exit code 1;
       last 10 log lines:
       > Missing dependencies for jeejah 0.3.2-1:
       >    luasocket 3.0rc1-2 (not installed)
       >
       > jeejah 0.3.2-1 depends on lua >= 5.1 (5.3-1 provided by VM: success)
       > jeejah 0.3.2-1 depends on luasocket 3.0rc1-2 (not installed)
       > Warning: Failed searching manifest: Failed downloading https://luarocks.org/manifest-5.3 - no downloader tool available, please install wget or curl in your system
       > Warning: Failed searching manifest: Failed downloading https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/manifest-5.3 - no downloader tool available, please install wget or curl in your system
       > Warning: Failed searching manifest: Failed downloading https://loadk.com/luarocks/manifest-5.3 - no downloader tool available, please install wget or curl in your system
       >
       > Error: Could not satisfy dependency luasocket 3.0rc1-2: No results matching query were found for Lua 5.3.
       For full logs, run 'nix log /nix/store/yqg0fkfdsxyfw1h6xbd3sdy817cj1565-lua5.3-jeejah-0.3.2-1.drv'.
error: 1 dependencies of derivation '/nix/store/mm0wmy5xz104b69k30mzzjifwrqfps88-lua-5.3.6-env.drv' failed to build
error: 1 dependencies of derivation '/nix/store/9cy388h84my69xi8554d51i05kcp7xlb-home-manager-applications.drv' failed to build
error: 1 dependencies of derivation '/nix/store/xjifp5166kkpwq584mqngdgychf1lwli-home-manager-fonts.drv' failed to build
error: 1 dependencies of derivation '/nix/store/xlx7a5sic4cl98nr1fl23dljs8ihi423-home-manager-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/sqkcaqq79i6yifxaj34zs0z8mgyjnman-home-manager-generation.drv' failed to build

wget and curl are already installed and on $PATH. Judging from the logs and the circumstances it seems to me that the derivation for jeejah is happening in an isolated environment where both of the commands are not available. How should make at least one of them available to the process that builds the derivations?