cachix / devenv

Fast, Declarative, Reproducible, and Composable Developer Environments
https://devenv.sh
Apache License 2.0
3.74k stars 277 forks source link

`.env` are not recognised when dotenv is enabled. #1321

Open Eveeifyeve opened 3 days ago

Eveeifyeve commented 3 days ago

Describe the bug When using dotenv it doesn't grab dotenv files.

Things I have tried to fix it

To reproduce https://gist.github.com/Eveeifyeve/fb7d6ce15e4e632e69dfe129023cac47

Logs:

direnv: loading ~/projects/TeaClient/API/.envrc                                                                                                                                                                                   
direnv: using flake . --impure
direnv: ([/nix/store/q71rzcnj4kpv6pp7alasws5si5dp216c-direnv-2.34.0/bin/direnv export zsh]) is taking a while to execute. Use CTRL-C to give up.
direnv: nix-direnv: Renewed cache
💡 The dotenv file '.env' was not found.

   To create this file, you can copy the example file:

   $ cp .env.example .env

direnv: export +AR +AS +CARGO_INSTALL_ROOT +CC +CFLAGS +CONFIG_SHELL +CXX +DATABASE_URL +DEVENV_DOTFILE +DEVENV_PROFILE +DEVENV_ROOT +DEVENV_RUNTIME +DEVENV_STATE +GIT_EXTERNAL_DIFF +IN_NIX_SHELL +LD +LD_DYLD_PATH +MACOSX_DEPLOYMENT_TARGET +NIX_BINTOOLS +NIX_BINTOOLS_WRAPPER_TARGET_HOST_aarch64_apple_darwin +NIX_CC +NIX_CC_WRAPPER_TARGET_HOST_aarch64_apple_darwin +NIX_CFLAGS_COMPILE +NIX_DONT_SET_RPATH +NIX_DONT_SET_RPATH_FOR_BUILD +NIX_ENFORCE_NO_NATIVE +NIX_HARDENING_ENABLE +NIX_IGNORE_LD_THROUGH_GCC +NIX_LDFLAGS +NIX_LDFLAGS_FOR_BUILD +NIX_NO_SELF_RPATH +NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_aarch64_apple_darwin +NIX_STORE +NM +PATH_LOCALE +PKG_CONFIG +RANLIB +RUSTDOCFLAGS +RUSTFLAGS +RUST_SRC_PATH +SIZE +SOURCE_DATE_EPOCH +STRINGS +STRIP +XDG_DATA_DIRS +ZERO_AR_DATE +__darwinAllowLocalNetworking +__impureHostDeps +__propagatedImpureHostDeps +__propagatedSandboxProfile +__sandboxProfile +cmakeFlags +configureFlags +mesonFlags +name +system -HOST_PATH -NIX_BUILD_CORES -__structuredAttrs -buildInputs -buildPhase -builder -depsBuildBuild -depsBuildBuildPropagated -depsBuildTarget -depsBuildTargetPropagated -depsHostHost -depsHostHostPropagated -depsTargetTarget -depsTargetTargetPropagated -doCheck -doInstallCheck -dontAddDisableDepTrack -nativeBuildInputs -out -outputs -patches -phases -preferLocalBuild -propagatedBuildInputs -propagatedNativeBuildInputs -shell -shellHook -stdenv -strictDeps ~PATH ~XPC_SERVICE_NAME

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.

domenkozar commented 3 days ago

We should error out since this feature doesn't work with Flakes.

Eveeifyeve commented 3 days ago

:(

domenkozar commented 3 days ago

@Eveeifyeve why do you need to use flakes? Maybe there's a way to use devenv cli.

Eveeifyeve commented 3 days ago

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.