The amount of hoop jumping required to add the macOS Big Sur CUPS driver is not worth the effort. The combination of SIP (System Integrity Protection) and the signed bootable APFS snapshot macOS System volume makes it very difficult to add the CUPS driver even if you could locate the driver source and compile it yourself since the original foo2zjs driver doesn't appear to be accessible any longer.
The printer is 12+ years old. Apple had issues with some other non-CUPS HP printer drivers whose drivers weren't notarized and the solution was to use AirPrint instead of drivers from HP. Most all new printers support Bonjour/ZeroConf/AirPrint.
Try going to the Mac App Store and searching for HP Smart for Desktop and installing that. With luck, it will detect the USB printer and offer a compatible driver for Big Sur. If that doesn't work then you may need to pursue a print server solution.
There are expensive commercial products such as the LANTRONIX xPrintServer which sells new for $363.40. But if you search eBay you can find an older used one under $60 USD. You plug the USB cable into the xPrintServer box as well as Ethernet & power and it makes the printer available over AirPrint to multiple devices including mobile devices. Big Sur will certainly be able to automatically add any AirPrint printer. Or you could build a DIY tiny computer such as a RaspberryPi, etc. running Linux with CUPS and AirPrint capabilities. That might be a fun little project and you could run other things on the RaspberryPi such as Pi-Hole or home automation projects. That option would cost more in materials and time spent.
The other alternative to consider buying a new printer. New models all support AirPrint and newer small desktop LaserJets are cheaper than the original cost of the HP LaserJet 1018 printer. You'll get better speed and more importantly, support for years to come.