Re: I installed doas, to get away from sudo, but what do I do with sudo now?
Reply #2 –
I've been running doas without sudo on my system for about 6 months now. The experience has been really good, doas has everything I need and has a very intuitive configuration syntax. You can remove sudo from Arch and Artix just fine without any major problems regarding the system itself.
Speaking from my experience, you'll eventually face some problems along the way, as you mentioned some packages are hard-coded with sudo by default. One way to fix this is simply creating a soft link on /usr/bin pointing /usr/bin/sudo to /usr/bin/doas. Then every time a package try to use sudo it will instead use doas. However keep in mind not every package will work with this, because doas does not have all the features sudo has, starting with flags, so if some package uses a flag doas does not have, it will not work. This is probably the best way for a lazy person to have a smooth transition from sudo to doas.
Another way (the one I use) is to simply not symlink and let things error-out so I can fix them myself either changing a config file or compiling the package again with doas support.
You mentioned makepkg is hard-coded to sudo, this is not true. You can edit /etc/makepkg.conf, on the last line there's a PACMAN_AUTH variable, you can just change it to doas and pacman will use doas along with makepkg.
Some couple tips I got from my experience:
If you use an AUR helper like paru (or yay), you can go to /etc/paru.conf and simply uncomment the [bin] line along with Sudo = doas, and now your AUR helper will also use doas.
A bit of a newbie advise is that sometimes you'll make mistakes to your doas.conf and you won't be able to use doas to fix it. Don't panic, you can use su or go to tty and login with root, then you won't need doas to edit /etc/doas.conf.
When using nopass in doas.conf, try to use args instead of the full command whenever possible, here are some examples from my doas.conf.
permit nopass :wheel as root cmd dinitctl args start wireguard
permit nopass :wheel as root cmd dinitctl args stop wireguard
permit nopass :wheel as root cmd dinitctl args restart dhclient
permit nopass :wheel as root cmd dinitctl args list
permit nopass :wheel as root cmd reboot
permit nopass :wheel as root cmd poweroff
permit nopass :wheel as root cmd cp args /etc/resolv.conf.fix /etc/resolv.conf
permit nopass :wheel as root cmd chattr args +i /etc/resolv.conf
permit nopass :wheel as root cmd chattr args -i /etc/resolv.conf