Created
June 13, 2025 20:49
-
-
Save Denperidge/9223b992224c59446b90bf4324a970fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
pkgs.mkShell { | |
buildInputs = with pkgs.buildPackages; [ | |
git | |
nodejs_22 | |
pnpm | |
bash | |
]; | |
# The shellHook below includes a workaround for | |
# https://discourse.nixos.org/t/add-bin-bash-to-avoid-unnecessary-pain/ | |
shellHook = '' | |
pnpm install | |
pnpm download-helper-binaries | |
binbash=/bin/bash | |
currentbin=/run/current-system/sw/bin/bash | |
if [ ! -f $binbash ]; then | |
echo "WARNING: /bin/bash not found, but this is needed for Husky scripts. Please make sure to symlink it to a bash binary!" | |
if [ -f $currentbin ]; then | |
echo "Found bash binary at $currentbin" | |
read -p "Symlink '$binbash' to '$currentbin'? [y/N] " yn | |
if [[ "$yn" == [Yy]* ]]; then | |
sudo ln -s /run/current-system/sw/bin/bash /bin/bash | |
fi | |
fi | |
fi | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment