make it possible to direnv exec . at top level

This way we don't have to be so careful about where we call `direnv
exec .` and can safely assume e.g. in scripts that we're always in the
direnv environment.
This commit is contained in:
Charles Hall 2024-11-01 12:21:43 -07:00
parent a520c4e032
commit d4ffa78979
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
2 changed files with 7 additions and 2 deletions

View file

@ -42,7 +42,7 @@ ci:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
script: script:
- ./bin/nix-build-and-cache ci - direnv exec . nix-build-and-cache ci
- direnv exec . engage - direnv exec . engage
cache: cache:
@ -57,7 +57,7 @@ artifacts:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
script: script:
- ./bin/nix-build-and-cache packages - direnv exec . nix-build-and-cache packages
pages: pages:
stage: deploy stage: deploy

View file

@ -43,4 +43,9 @@ mkShell {
default.propagatedBuildInputs default.propagatedBuildInputs
++ ++
default.buildInputs; default.buildInputs;
shellHook = ''
# Workaround for <https://github.com/NixOS/nix/issues/8355>
unset TMPDIR
'';
} }