I've changed the PATH environment variable of the root user. The following command are there too show the PATH.
su
env | grep ^PATH
PATH=/root/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/opt/distrod/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/pierre/.nix-profile/bin
But
sudo env | grep ^PATH
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
What have I missed?
I know that if write
sudo echo $PATH
it doesn't work because PATH is already evaluated before changing user. I don't think that it is a problem like this but I have no others idees