Skip to content

nixcache: automatically configure nix daemon #1996

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

Merged
merged 3 commits into from
Apr 15, 2024
Merged

Conversation

gcurtis
Copy link
Collaborator

@gcurtis gcurtis commented Apr 12, 2024

Before installing packages, check to see if the Nix daemon is already configured to use a Devbox cache when one is available. The user no longer needs to explicitly call devbox cache configure, however the command is still there (and hidden) to make sudo escalation possible.

There are a few known limitations in this initial implementation:

  • We don't keep track of "no" responses to sudo, so Devbox will bug the user every time if they refuse.
  • The Nix daemon needs to restart after adding a trusted user. We currently only support auto-restarting the daemon on macOS and assume its managed with launchd.
  • We sleep rather than poll for the daemon to restart. This only happens when a trusted user is added, but it does make things a little flakier.

Before installing packages, check to see if the Nix daemon is already
configured to use a Devbox cache when one is available. The user no
longer needs to explicitly call `devbox cache configure`, however the
command is still there (and hidden) to make sudo escalation possible.

There are a few known limitations in this initial implementation:

- We don't keep track of "no" responses to sudo, so Devbox will bug the
  user every time if they refuse.
- The Nix daemon needs to restart after adding a trusted user. We
  currently only support auto-restarting the daemon on macOS and assume
  its managed with launchd.
- We sleep rather than poll for the daemon to restart. This only happens
  when a trusted user is added, but it does make things a little
  flakier.
@gcurtis gcurtis requested a review from mikeland73 April 12, 2024 22:15
@gcurtis gcurtis merged commit 86392ce into main Apr 15, 2024
@gcurtis gcurtis deleted the gcurtis/nix-config-edit branch April 15, 2024 15:32
Copy link

sentry-io bot commented Apr 26, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ *exec.ExitError: <redacted usererr.combined>: nix build exit code: 1, output: <redacted []uint8>, err: <redacted ... go.jetpack.io/devbox/internal/nix in Build View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants