NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.07k stars 14.08k forks source link

nixos-rebuild fails if current directory is on a sshfs mount #121142

Open sbourdeauducq opened 3 years ago

sbourdeauducq commented 3 years ago

Describe the bug nixos-rebuild boot fails when run from a directory that is on a sshfs mount

To Reproduce

~# sshfs remote:~/fs /remotefs
~# cd /remotefs
/remotefs # nixos-rebuild boot
...
building '/nix/store/....-20.09.3975.17b101e29df.drv'...
updating GRUB 2 menu...
cannot stat initial working directory for /remotefs: Permission denied at /nix/store/n6z6v14fxiwfg3j6046c6pdkb7wyvmx7-perl-5.32.0/lib/perl5/5.32.0/File/Temp.pm line 916.

Strangely enough, the problem is not reproducible with a read-only bind mount.

Expected behavior nixos-rebuild does not needlessly attempt to access the current directory, and completes without error.

tomodachi94 commented 6 days ago

cc nixos-rebuild maintainer @Profpatsch