devenv icon indicating copy to clipboard operation
devenv copied to clipboard

feat: add `devenv.flakeArgs` to avoid `--no-pure-eval`

Open Atry opened this issue 1 year ago • 5 comments

This PR avoids --no-pure-eval in devenv-devShell.nix, in favor of "--override-input" "devenv-root" "path:.devenv/state/pwd".

Atry avatar Sep 05 '24 18:09 Atry

@domenkozar What do you think?

Atry avatar Sep 10 '24 19:09 Atry

I like the idea of making devenv more pure but I would avoid putting necessary steps into the .envrc file. This way direnv becomes a dependency, currently it's just a nice tool to have. In CI I would then either need to have direnv present or make the state directory manually. The the moment it its enough to just run nix develop --no-pure-eval --command some-test-command

BTW. isn't devenv-root at .devenv and devenv-state would be .devenv/state?

Nebucatnetzer avatar Sep 11 '24 07:09 Nebucatnetzer

I like the idea of making devenv more pure but I would avoid putting necessary steps into the .envrc file. This way direnv becomes a dependency, currently it's just a nice tool to have. In CI I would then either need to have direnv present or make the state directory manually. The the moment it its enough to just run nix develop --no-pure-eval --command some-test-command

This PR did not affect nix develop --no-pure-eval --command some-test-command behavior in general. It just makes devenv up in flake base projects pure. It does not affect devenv up in devenv.yaml based projects because they have a different implementation of devenv.

Since it changed devenv up, I updated the PR in 56f801a to keep supporting nix develop --no-pure-eval --command devenv up for flake projects that do not include an .envrc, so the direnv is not a dependency any more.

BTW. isn't devenv-root at .devenv and devenv-state would be .devenv/state?

Yes

Atry avatar Sep 11 '24 20:09 Atry

@domenkozar Potentially devenv.yaml based projects could also utilize the .devenv/state/pwd file to avoid --no-pure-eval, but it is out of the scope of this PR.

Atry avatar Sep 11 '24 20:09 Atry

This PR did not affect nix develop --no-pure-eval --command some-test-command behavior in general.

We have some PHP tests that write session files to .devenv/state/php-fpm so they wouldn't have worked anymore. Thank you for updating it :).

Nebucatnetzer avatar Sep 12 '24 06:09 Nebucatnetzer