Open alirezamirsepassi opened 2 months ago
This breaks on devenv with:
error:
error: A definition for option `dotenv.files."[definition 1-entry 1]"' is not of type `path'. Definition values:
- In `/nix/store/virtual0000000000000000000000007-source/src/modules/integrations/dotenv.nix': ".env"
because the semantics of the paths are different, I'll think about it how to properly integrate it.
Hey @domenkozar
Thanks for your reply.
IMO, the path type isn't very important for the module and it can be switched back to a simple string as the file path will be verified to exist later in the module using pathExists anyway.
On second thought, we might not even want to have the path type as it will be copied to the Nix store if I'm not mistaken and it might contain some secrets that can't be managed directly/easily on the machine which later can be extracted by others. 🤔
let me know what you think. 🙏🏻
@domenkozar I switched the type back to string and wrapped the default value in a double quotation to avoid nix copying it to the store.
Could you try again on devenv, please?
@domenkozar any updates on this?
Thanks for the ping, CI is running
nix build
PATH=$PWD/result/bin:$PATH ./result/bin/devenv-run-tests --only dotenv tests
I get
error: string '.env' doesn't represent an absolute path
This pull request enables the dotenv integration to accept full paths to the dotenv files. Additionally, I've changed the option
filename
tofiles
and moved the normalize function to the option itself usinglib.toList
. I've also added a warning regarding the updated option name to prevent users from breaking their environments.P.S. I chose to use
config.devenv.root
instead ofself
becauseself
evaluates to the nix store source tree when used in a flake configuration. Since dotenv files are typically not committed to a git repository, they won't be present after the copy.