I am using flake to manage my nixos(23.05), recently i installed home-manager. It is working fine but now sudo is not working.
It is throwing this error : sudo: /run/current-system/sw/bin//sudo must be owned by uid 0 and have the setuid bit set
That’s interesting. If all you changed was the home-manager stuff, you should be fine. So it might be something strange in your ./home.nix? Though even that’s kinda hard to believe.
bash = {
enable = true;
initExtra = ''
# Make Nix and home-manager installed things available in PATH.
export PATH=/run/current-system/sw/bin/:/nix/var/nix/profiles/default/bin:$HOME/.nix-profile/bin:/etc/profiles/per-user/$USER/bin:$PATH
'';
};
Well there it is. You’re putting /run/current-system/sw/bin before everything in PATH. But NixOS puts that behind /run/wrappers/bin.