@@ -50,15 +50,16 @@ def format(self, record):
5050TMP_FILE = "$(mktemp)"
5151GENERATED_NIXFILE = "pkgs/development/lua-modules/generated-packages.nix"
5252
53- HEADER = """/* {GENERATED_NIXFILE} is an auto-generated file -- DO NOT EDIT!
54- Regenerate it with: nix run nixpkgs#luarocks-packages-updater
55- You can customize the generated packages in pkgs/development/lua-modules/overrides.nix
53+ HEADER = """/*
54+ {GENERATED_NIXFILE} is an auto-generated file -- DO NOT EDIT!
55+ Regenerate it with: nix run nixpkgs#luarocks-packages-updater
56+ You can customize the generated packages in pkgs/development/lua-modules/overrides.nix
5657*/
5758""" .format (GENERATED_NIXFILE = GENERATED_NIXFILE )
5859
5960FOOTER = """
6061}
61- /* GENERATED - do not edit this file */
62+ # GENERATED - do not edit this file
6263"""
6364
6465
@@ -118,10 +119,16 @@ def generate_nix(self, results: list[tuple[LuaPlugin, str]], outfilename: str):
118119 with tempfile .NamedTemporaryFile ("w+" ) as f :
119120 f .write (HEADER )
120121 header2 = textwrap .dedent (
121- """
122- { stdenv, lib, fetchurl, fetchgit, callPackage, ... }:
123- final: prev:
124- {
122+ """
123+ {
124+ stdenv,
125+ lib,
126+ fetchurl,
127+ fetchgit,
128+ callPackage,
129+ ...
130+ }:
131+ final: prev: {
125132 """
126133 )
127134 f .write (header2 )
@@ -231,7 +238,8 @@ def generate_pkg_nix(plug: LuaPlugin):
231238 log .debug ("running %s" , " " .join (cmd ))
232239
233240 output = subprocess .check_output (cmd , text = True )
234- output = "callPackage(" + output .strip () + ") {};\n \n "
241+ ## FIXME: luarocks nix command output isn't formatted properly
242+ output = "callPackage(\n " + output .strip () + ") {};\n \n "
235243 return (plug , output , None )
236244 except subprocess .CalledProcessError as e :
237245 log .error ("Failed to generate nix expression for %s: %s" , plug .name , e )
0 commit comments