Skip to content

Commit 5afed24

Browse files
authored
Use nix-shell to launch the bash shell (#179)
I wish we could just rely on /bin/bash being recent enough.
1 parent 9fba612 commit 5afed24

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

flake.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,13 @@
225225
in (import nixpkgs { system = "x86_64-linux"; }).writeTextFile {
226226
name = "devx";
227227
executable = true;
228+
# We use nix-shell to invoke bash, to work around some shells being just too ancient.
229+
# This primarily happens on macOS. But as the sourced env may expect a bash version
230+
# current with the current nix, using nix-shell to launch the bash is probably the
231+
# most reliable option.
228232
text = ''
229-
#!/bin/bash
233+
#! /usr/bin/env nix-shell
234+
#! nix-shell -i bash -p bash
230235
231236
set -euo pipefail
232237

0 commit comments

Comments
 (0)