Skip to content

Nix doesn't work in Github Codespaces #6680

@kzvi

Description

@kzvi

Describe the bug

  1. 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-daemon command. Then the Nix commands are accessible and appear to work, but building anything fails. For example, running

    nix-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 
  2. 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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    other-linuxNix on a Linux distro that is not a NixOS-derivativequestion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions