devenv
devenv copied to clipboard
dotenv is not working on v1.0.4
Describe the bug
{
dotenv.enable = true;
}
is not working after upgrading from v1.0.3 to v1.0.4
To reproduce
- upgrade
devenvtov1.0.4, - make sure
dotenv.enableis set totrue, - run
devenv up, - envs from
.envis not getting picked up.
Version
devenv 1.0.4 (aarch64-darwin)
Same here
@albertilagan, I can't seem to replicate this. Am I missing anything?
This the setup I used: https://gist.github.com/sandydoo/640404ce7f88a0f5bbf3c27875ee1453
I'm having the same issue, configuring the environment using a flake
If you're experiencing this issue, please post gists with your devenv.nix, devenv.yaml, and devenv.lock files.
If you're experiencing this issue, please post gists with your
devenv.nix,devenv.yaml, anddevenv.lockfiles.
https://gist.github.com/chocoladisco/9a60fdd7217aba5607c1e401393726af
This gives me the error message the dotenv file .env was not found
@chocoladisco most probably it's because you use flake. And git flakes are not coping flies that are not added to git. Try to exclude .env from .gitignore and git add .env. It should "fix" an issue.
The other question is that you most probably don't want to include .env to git. I would love to know proper solution for this
most probably it's because you use flake. And git flakes are not coping flies that are not added to git.
Correct. This is well-known design problem with flakes. I don't believe we have any workarounds for this, so if you rely on the dotenv integration, I'd recommend using the devenv cli.
Yes, that is what I came up with eventually nodePackages.dotenv-cli + dotenv in .envrc after use flake ...
Closing this because we can't get a response from the OP.
If you're using flakes, the dotenv integration will not work. A Nix flake requires you to track all of the files you need in your config. This is a design limitation/flaw of Nix flakes.
Use devenv's enterShell or direnv's .envrc to source your .env files.