nix-dev-home icon indicating copy to clipboard operation
nix-dev-home copied to clipboard

executables like `sudo` in NixOS come from `/run/wrappers/bin`

Open shivaraj-bh opened this issue 1 year ago • 3 comments

If not present, sudo command will fail to run in NixOS if someone is sharing this configuration across NixOS, macOS and other linux distro.

This is on my NixOS:

shivaraj in 🌐 nixos in nix-dev-home on  export-wrappers-path
❯ which sudo
/run/wrappers/bin/sudo

shivaraj-bh avatar Mar 04 '24 14:03 shivaraj-bh

If not present, it might be symlinked elsewhere, like:

❯ which sudo
/run/current-system/sw/bin/sudo

Leading to:

❯ sudo
sudo: /run/current-system/sw/bin/sudo must be owned by uid 0 and have the setuid bit set

shivaraj-bh avatar Mar 04 '24 14:03 shivaraj-bh

This might be related: https://discourse.nixos.org/t/sudo-run-current-system-sw-bin-sudo-must-be-owned-by-uid-0-and-have-the-setuid-bit-set-and-cannot-chdir-var-cron-bailing-out-var-cron-permission-denied/20463

shivaraj-bh avatar Mar 04 '24 16:03 shivaraj-bh

Alternatively, we can just test for stdenv.isLinux.

srid avatar Mar 17 '24 11:03 srid

Let's re-evaluate this as part of #86

srid avatar Oct 04 '24 15:10 srid