Skip to content

devenv conventions and DIRENV_ALLOW #19

Description

@devinrsmith

I'm trying to make sure I understand devenv conventions and how it works with DIRENV_ALLOW, https://github.com/systemstart/claude-microvm#nix-dev-shell-support

Looking at

claude-microvm/flake.nix

Lines 255 to 256 in 676d2fc

if [ "''${DIRENV_ALLOW:-0}" = "1" ] && { [ -f "$WORK/flake.nix" ] || [ -f "$WORK/.devenv.flake.nix" ]; }; then
_CURRENT_HASH="$( (cat "$WORK/flake.nix" "$WORK/flake.lock" "$WORK/.devenv.flake.nix" "$WORK/devenv.nix" "$WORK/devenv.yaml" "$WORK/devenv.lock" 2>/dev/null || true) | sha256sum | cut -c1-16)"
, I see that the top level must contain flake.nix or .devenv.flake.nix file.

I'm trying to follow devenv "best practices", and they suggest starting with devenv CLI:

https://devenv.sh/guides/using-with-flakes/#choosing-between-devenv-and-nix-flakes
https://devenv.sh/getting-started/#initial-set-up

$ devenv init
• Creating devenv.nix
• Creating devenv.yaml
• Creating .gitignore

I'm doing this for an existing project that hasn't used nix before. Neither flake.nix, nor .devenv.flake.nix is being created. Doing a bit of looking, it seems like .devenv.flake.nix was an internal implementation detail on previous versions of devenv, maybe no longer relevant?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions