Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update templates .envrc files #1428

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions templates/flake-parts/.envrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
Copy link
Contributor

@thenonameguy thenonameguy Sep 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this current direnvrc direnv extension, this breaks the nix_watches extra functionality, as devenv doesn't use https://github.com/nix-community/nix-direnv directly.

Copy link
Author

@miranbastaja miranbastaja Sep 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I bumped the version to 2.5.0 as that's the version that nix_direnv_watch_file was originally deprecated in. Sorry for the inconvenience, I'm not familiar with the more advanced usage of direnv.

fi

nix_direnv_watch_file flake.nix
nix_direnv_watch_file flake.lock
watch_file flake.nix
watch_file flake.lock

DEVENV_ROOT_FILE="$(mktemp)"
printf %s "$PWD" > "$DEVENV_ROOT_FILE"
Expand Down
4 changes: 2 additions & 2 deletions templates/terraform/.envrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi

nix_direnv_watch_file flake.nix
nix_direnv_watch_file flake.lock
watch_file flake.nix
watch_file flake.lock
if ! use flake . --impure
then
echo "devenv could not be built. The devenv environment was not loaded. Make the necessary changes to devenv.nix and hit enter to try again." >&2
Expand Down