There are other things governments could do though.
Coming from a US perspective, the biggest one would be to pass some kind of law that employment contracts can't prevent you moonlighting for the government. I'd probably be willing to pick up some contract work to do on the cheap, but I can't because of my employment contract.
Another is that the government already has access to a lot of things I don't, and I'd be willing to trade my time for access to some of those things. Free flights on army cargo planes would be a great perk. I would totally do some work if they'd let me drive a tank for like 30 minutes and fire the cannon down the range a couple times. They probably have access to HPC clusters that would tempt some (I don't have the skills to have the interest, but I'm sure many do).
Government pensions are another option, although they'd have to require less than 40 hours a week of work to qualify. It might end up being more expensive than just paying more.
Tax breaks are another option. Someone would have to figure up the demand curve, but a 10% cut to my effective tax rate would be tempting depending on the amount of work required.
Free education would be another option if they could offer it for part time work.
I don't feel that the government has gotten particularly creative in trying to attract talent. The pay is bad, the job is a bureaucratic nightmare, and the perks kind of suck other than the pension.
The downside is that a lot of those are likely to piss off the rest of the government employees.