Skip to content
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

Direnv hangs in flake projects that add extra-substituters or extra-trusted-public-keys #1491

Open
therealpxc opened this issue Oct 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@therealpxc
Copy link
Contributor

Describe the bug
When an envrc is loading, it seems direnv doesn't or can't get user input from the shell, so if that envrc prompts Nix to do something interactive, like ask for user confirmation of binary caches that the project specifies, direnv just hangs indefinitely.

To reproduce

  1. Create a new project using the flake-parts template.
  2. Change nixConfig.extra-trusted-public-keys and nixConfig.extra-substituters to lists, and add entries for a binary cache that you've not previously interactively approved at your machine/as your user.
  3. Run git init and then add the files from the template to the git index with git add .gitignore and then git add ..
  4. Run direnv allow, and observe that direnv hangs forever. Although it will look like it's giving you a yes/no prompt, typing y or n and hitting enter will not do anything.

Workaround
You can hit CTRL+C to cancel the prompt from evaluating, and then run nix develop --impure. You'll be prompted to approve or reject the additional substituter and public key, but this time it'll be a real prompt that accepts your input. If you tell it to persist your decision, direnv evaluation will succeed after that.

Version
devenv: 1.2.0

@therealpxc therealpxc added the bug Something isn't working label Oct 1, 2024
@therealpxc
Copy link
Contributor Author

Looks like this is caused by some kind of issue in direnv: direnv/direnv#1022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant