-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nix in DevContainers #913
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In trying to use nix inside of Devcontainers, I encountered 2 issues, which were resolved with the helpful folks on Determinate Systems Discord (#nix-installer).
They are reported here in case they might be of further use.
1- Bad permissions on
/tmp
This issue is specific to GitHub CodeSpaces, where it seems the
/tmp
filesystem, is injected into the development environment with problematic default ACL permissions.This is fixed with the following snippet in the
postCreateCommand
script (assuming the script hassudo
powers):Before/After ACL state
Before fix:After fix:
2- Starting the nix-daemon
In our case, we are invoking the installer without an
init
system within a multiuser install:This means we either need to invoke
nix
asroot
or start thenix-daemon
ourselves.Unfortunately when we start the daemon process from our
postCreateCommand
, it would be terminated at the script's end, even when put into the background.Starting the
nix-daemon
withnohup
solves the problem, as we can see in thispostCreateCommand
snippet:tl;dr - Context
I am trying to establish a working general development environment based on Nix using devcontainers
I am specifically targeting both:
Devcontainers have a very flexible lifecycle which allows for many ways of preparing the development environment.
Dockerfile
"postCreateCommand"
attribute of the.devcontainer/devcontainer.json
The text was updated successfully, but these errors were encountered: