Use a spark plug.
Blackpowder Munitions Thread
ATF re-classified these as firearms and halted production. Originals are exempt but pricey and if you can find any new old-stock ammo it ain't cheap either. New production ammo is banned because it can be electronically ignited and the ATF considers electric ignited guns to be machine guns now. There's a few exceptions for certain .22 target pistols but they use cased ammo and are all single-shot bolt-action.
I considered this, but I'm still trying to figure out how I'd attach a lighter flint to a trigger without doing a fair amount of machine work. It could be doable, but I'm not sure how yet.
I'd imagine you could use a spring-loaded hammer to open a frizzen and strike the flint wheel at the same time, but I think you'd have to drill into that tiny wheel to attach something so you could reliably spin it.
What I've seen suggests that it's actually pretty hard to ignite BP electrically, or else I'd be looking at piezo. I'm definitely not keen on needing batteries to shoot my gun.
either make it a clock spring or use a "piston" and make a short drive chain to spin it with the trigger being a "lever" more than a trigger, I think there are a few toys that do this. you also might build a ratcheting "hammer."
I'd use an old stove sparker, think a zippo flint but on a footlong device.
Have you thought about a wheellock?
I've got one just like that from my dead grandmother.
Powder itself is still illegal to own without license, or at all in some countries. But true, you can make it with just fertilizer and some charcoal, although the former is again illegal or tracked in some countries. If you do any farm work you got plausible deniability if any police come knocking, though.
You can make potassium nitrate from compost if you have to.
If you want to go that route, then an underhammer action might serve you better:
underhammers.blogspot.com