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: Problems with imported nix file changes #1229

Open
vHanda opened this issue May 24, 2024 · 1 comment
Open

direnv: Problems with imported nix file changes #1229

vHanda opened this issue May 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@vHanda
Copy link

vHanda commented May 24, 2024

Describe the bug
I'm trying to share my devenv.nix configuration across my company, so that more people might be inclined to move towards nix and devenv, instead of having ad-hoc environments.

Since we have many repos, I don't want to create and maintain the devenv files per repo. I'd prefer to do it globally. I've done this by having the devenv.nix/yaml/lock files in a single repo, and asking people to include it in their devenv.nix yaml config.

imports:
  - ./relevant-repo/devenv

I like using devenv with direnv so that one doesn't have to use the 'devenv shell' command.

Via 'devenv shell' everything works great.

Problems -

  • If I change the imported nix files, the other terminals do not automatically rebuild. They do not seem to be watching the file.
  • If I run devenv shell, I get the newly added packages from the imported nix file. However, if I then create a new terminal and enter the project directory and the env is loaded via direnv is not the old one without this package.
  • It's quite a pain, as I'd be happy to run a command to force direnv to use the latest, but I cannot seem to figure out how.
  • Very occasionally when I modify the imported nix files, it does seem to pickup the changes, but very rarely.

What command can I use to force 'direnv' to use the latest devenv files?

Version

devenv 1.0.5 (x86_64-linux) - Not using flakes

@vHanda vHanda added the bug Something isn't working label May 24, 2024
@thenonameguy
Copy link
Contributor

thenonameguy commented May 24, 2024

  1. I would add an input to a shared Github repository instead of a local folder
  2. Once the above is done, you can run devenv update to explictly bump the internal Flake input for the shared config. This also updates the lock file, making the update more explicit.

This is somewhat of a duplicate of #14

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

2 participants