-
- Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Describe the bug
-
Using the default Codespaces environment/image without any configuration, it is possible to install Nix in single-user mode using the
sh <(curl -L https://nixos.org/nix/install) --no-daemoncommand. Then the Nix commands are accessible and appear to work, but building anything fails. For example, runningnix-build -E 'with import <nixpkgs> {}; writeText "a" "b"'produces the enigmatic error
error: suspicious ownership or permission on '/nix/store/ywzcczbp6n4c944jrk99vi7wjws0kx2n-a.drv.chroot/nix/store/5jz2jpipwd0y7iixvi3kax0ydr9zp6cq-a' for output 'out'; rejecting this build output -
Attempting to install Nix in multi-user mode fails with the error message
error: getting attributes of path '/nix/store/lvqrpsasgr3jan8l6yfhvcv628jayk2x-busybox-static-x86_64-unknown-linux-musl-1.32.1/bin/busybox': Permission denied
Expected behavior
Running Nix in Github Codespaces is probably something that a lot of people will want to do. Even if it is the case that Nix can't support it, it would probably be helpful to have some documentation that states that it is unsupported and/or describes potential workarounds.
Edit: A solution found by @offlinehacker is to first run sudo apt install -y acl && sudo setfacl -k /tmp. Then Nix can be installed normally and building things will succeed. See #6680 (comment).