From 0ef64e51a1ed07f28bc9549bd682af8f802506d8 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Sat, 1 Feb 2025 17:54:23 +0900 Subject: [PATCH] Use nix-shell to launch the bash shell I wish we could just rely on /bin/bash being recent enough. --- flake.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index db5d741..eed2ce9 100644 --- a/flake.nix +++ b/flake.nix @@ -225,8 +225,13 @@ in (import nixpkgs { system = "x86_64-linux"; }).writeTextFile { name = "devx"; executable = true; + # We use nix-shell to invoke bash, to work around some shells being just too ancient. + # This primarily happens on macOS. But as the sourced env may expect a bash version + # current with the current nix, using nix-shell to launch the bash is probably the + # most reliable option. text = '' - #!/bin/bash + #! /usr/bin/env nix-shell + #! nix-shell -i bash -p bash set -euo pipefail