diff --git a/nix/dev-shell.nix b/nix/dev-shell.nix --- a/nix/dev-shell.nix +++ b/nix/dev-shell.nix @@ -39,7 +39,6 @@ , shellcheck , sqlite , terraform -, watchman , rustfmt , yarn }: @@ -61,7 +60,6 @@ mariadb nodejs-16_x-openssl_1_1 yarn - watchman # react native python3 redis @@ -137,6 +135,8 @@ wait "$mariadb_pid" "$redis_pid" ${../scripts}/install_homebrew_macos.sh + + ${../scripts}/install_homebrew_deps.sh watchman '' + '' # Render default configuration for keyserver diff --git a/scripts/install_homebrew_deps.sh b/scripts/install_homebrew_deps.sh new file mode 100755 --- /dev/null +++ b/scripts/install_homebrew_deps.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if ! command -v brew >/dev/null; then + echo "Homebrew is required to run this script" >&2 + exit 1 +fi + +install_if_missing() { + local package="$1" + + if ! command -v "$package" >/dev/null; then + brew install "$package" + fi +} + +for dep in "$@"; do + install_if_missing "$dep" +done