From d4ffa7897977be5c1763e45783c0e56a076c588f Mon Sep 17 00:00:00 2001 From: Charles Hall Date: Fri, 1 Nov 2024 12:21:43 -0700 Subject: [PATCH] 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. --- .gitlab-ci.yml | 4 ++-- nix/shell.nix | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6ecc662d..e73cbc9c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -42,7 +42,7 @@ ci: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_PIPELINE_SOURCE == 'merge_request_event' script: - - ./bin/nix-build-and-cache ci + - direnv exec . nix-build-and-cache ci - direnv exec . engage cache: @@ -57,7 +57,7 @@ artifacts: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - if: $CI_PIPELINE_SOURCE == 'merge_request_event' script: - - ./bin/nix-build-and-cache packages + - direnv exec . nix-build-and-cache packages pages: stage: deploy diff --git a/nix/shell.nix b/nix/shell.nix index 1d72941c..4373a0b5 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -43,4 +43,9 @@ mkShell { default.propagatedBuildInputs ++ default.buildInputs; + + shellHook = '' + # Workaround for + unset TMPDIR + ''; }