diff --git a/nix/dev-shell.nix b/nix/dev-shell.nix --- a/nix/dev-shell.nix +++ b/nix/dev-shell.nix @@ -40,7 +40,6 @@ , sops , sqlite , terraform -, watchman , rustfmt , wasm-pack , yarn @@ -66,7 +65,6 @@ mariadb nodejs yarn - watchman # react native python3 redis wasm-pack @@ -143,6 +141,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 100644 --- /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