-
Notifications
You must be signed in to change notification settings - Fork 415
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 feature #228
Nix feature #228
Conversation
//cc @lostintangent @ghuntley given previous interest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome. Thank you! 👏
Left some comments.
Dropped the derivation property in favor of flake given you currently can't use a .nix file from the source tree (could be added later once we have postCreateCommand support in features). Also noticed other features seem to be using comma separation for lists so adjusted to match. |
Test failures in CI were expected since (as covered by NOTES.md), single-user does not work without doing a chown post-create on Linux when the host's UID updates. So added the chown to the test with a warning. |
@samruddhikhandale Also I think I accidently deleted a comment you made when trying to delete a comment I made. 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome. Thank you! 👏 👏
🚀 🚀
Can someone help with some more detailed instructions on how to use this? I tried adding the feature and getting a lot of errors. Different errors, no obvious pattern. This one is common:
|
@dsyer Would you mind raising an issue with your specifics? In particular the base image you are using, OS, architecture, etc. Possible there's a scenario where things are not working as expected. That particular error though sounds like its actually having a hard time downloading the feature itself which could be connectivity related. #275 is very specific to the universal image, for example. |
That's it really, for the specifics. The JSON is just the default if you add ubuntu and nix. My network connectivity is generally good here locally. Maybe there was a DNS glitch out there somewhere? 185.199.111.154 looks like Github (not gcr.io). |
@dsyer Raised devcontainers/cli#281 for you. Folks won't reply to a merged PR. |
This PR adds a dev container feature for Nix. It supports using base images from Debian/Ubuntu, the RHEL tree, and Alpine.
I refactored some utilities into a utils.sh file to make the main script more readable.
The feature can just install nix, or install nix and a set of packages, a Flake, or a derivation. This is limited to things in the base image (or remote URIs in the case of Flakes) due to the lack of lifecycle hook support (devcontainers/spec#60). We can update once that is available.
Given Nix is picky about privs, the script supports doing both a single user and multi-user install. NOTES.md includes info on what each does and downsides by scenario.
Given the breadth of the capabilities, there's also a battery of tests which were unblocked by recent tweaks to the devcontainer CLI's testing setup.