The nix-installer assumes that you have a distro that uses sudo. This is not always the case, some distro's (e.g. Alpine) use doas.
I would recommend to make the nix-installer check if doas is available and use it and fall back to sudo if it's not.
The reason that I wouldn't do it the other way around is that if distro's have sudo and doas both available usually support the newer doas better. sudo is usually just a "fake" sudo that calls doas so should get preference.
And for distro's that only have 1 of the two commands available, the order shouldn't matter anyway.
The nix-installer assumes that you have a distro that uses sudo. This is not always the case, some distro's (e.g. Alpine) use doas.
I would recommend to make the nix-installer check if doas is available and use it and fall back to sudo if it's not.
The reason that I wouldn't do it the other way around is that if distro's have sudo and doas both available usually support the newer doas better. sudo is usually just a "fake" sudo that calls doas so should get preference.
And for distro's that only have 1 of the two commands available, the order shouldn't matter anyway.