From 3f5f7a602d98792d489440e5587280fcc8293c7c Mon Sep 17 00:00:00 2001 From: Bryan Bennett Date: Sun, 11 Aug 2024 12:18:57 -0400 Subject: [PATCH] Run shellcheck on direnvrc during checkPhase --- default.nix | 4 ++++ direnvrc | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/default.nix b/default.nix index 10fc287..9f3d381 100644 --- a/default.nix +++ b/default.nix @@ -11,6 +11,7 @@ , re , reason , sha +, shellcheck , upx , }: @@ -38,6 +39,9 @@ buildDunePackage { # patchELF can't handle UPX'd binaries # We produce a static OCaml binary that dontPatchELF = true; + postCheck = '' + ${shellcheck}/bin/shellcheck direnvrc + ''; postPatch = '' substituteInPlace direnvrc --replace-fail "@flake_env@" "$out/bin/flake_env" ''; diff --git a/direnvrc b/direnvrc index 5103249..64ddcfd 100644 --- a/direnvrc +++ b/direnvrc @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + # The below code is taken largely from nix-direnv. # nix-direnv's license is replicated below: # @@ -38,7 +40,8 @@ use_flake_env() { local old_tempdir=${TEMPDIR:-__UNSET__} local old_xdg_data_dirs=${XDG_DATA_DIRS:-} - local ld=$(direnv_layout_dir) + local ld + ld=$(direnv_layout_dir) export direnv local flake_reference="${1:-"."}"