You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dream2nix allows setting path.projectRootFile, so that the script traverses the file tree up to finding this file, to find what is considered the project root.
That should let devenv flakes be evaluated purely, while still having a working dev shell with direnv, nix-shell or nix develop.
The text was updated successfully, but these errors were encountered:
This only works for scripts that are executed afterenterShell. There is a lot of value in knowing the project root path during the shell build, i.e. inside of Nix.
dream2nix allows setting path.projectRootFile, so that the script traverses the file tree up to finding this file, to find what is considered the project root.
devenv is currently implemented on top of Nix flakes. Flakes are always copied to the store before evaluation, so any path traversal would return the immutable store path. In fact, this root path is exposed as an API within flakes, but it's not useful to us for hooking up local state. What we want instead is the original path to your project.
I'm being affected by DeterminateSystems/flakehub-push#170.
Of course that's not devenv's fault. However, it made me wonder: why do we need a static value? This is how it's defined:
devenv/src/modules/top-level.nix
Lines 164 to 168 in 8f8c96b
We can learn from other projects.
devshell uses environmental values from nix shell or direnv if available, and otherwise allows to provide a fallback script that can apply any custom logic that sets their
PRJ_ROOT
variable.dream2nix allows setting
path.projectRootFile
, so that the script traverses the file tree up to finding this file, to find what is considered the project root.That should let devenv flakes be evaluated purely, while still having a working dev shell with direnv,
nix-shell
ornix develop
.The text was updated successfully, but these errors were encountered: