Pacman failed to install linux58-nvidia-340xx

There’s a thread about the depreciation of 340 drivers here

Just reading through it it seems you may need to be on a lts kernel like 5.4