-
Notifications
You must be signed in to change notification settings - Fork 296
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
.env
are not recognised when dotenv is enabled.
#1321
Comments
We should error out since this feature doesn't work with Flakes. |
:( |
@Eveeifyeve why do you need to use flakes? Maybe there's a way to use devenv cli. |
Well here is the thing I have all of my devenv in flakes and flakes are a much easier way to write than a yaml file. |
If you are still looking for a solution:
|
I will get around trying the direnv method that you have suggested I will let you know asap how it goes. |
Update I have tried it still doesn't work. I have specified in one project with .env.development and .env.production I can try with another project and see what happens. It seems the It seems to be a git issue with nix not including files that are in gitignore like |
It actually does, it's because nix is not including files that are in gitignore. |
Also the .env files thing is really bad practises as it gets included in nix store on eval time. This is why stuff like agenix that secure it that way if a hacker get access to your file system and transfer the files to their computer, they won't be able to decrypt without being on the actual system. |
Another options is to use enterShell to load the .env dynamically. So it does not need to be in the nix store and not stracked by git. {
enterShell = ''
[ ! -f .env ] || export $(grep -v '^#' .env | xargs)
'';
} |
I will try this in a few days. |
Describe the bug
When using dotenv it doesn't grab dotenv files.
Things I have tried to fix it
nix develop --impure
to see if direnv was the issue.NixOS/nixpkgs/nixos-unstable
toNixOS/nixpkgs/nixpkgs-unstable
&NixOS/nixpkgs/nixpkgs-unstable
tocachix/devenv-nixpkgs/rolling
To reproduce
https://gist.github.com/Eveeifyeve/fb7d6ce15e4e632e69dfe129023cac47
Logs:
Well I expect to happen is all of my
.env
variables to be available in the dev shell.Version
I am using flakes and it's on version 1.0.7.
The text was updated successfully, but these errors were encountered: