#!/bin/bash # omarchy:summary=Install a supported development environment # omarchy:name=dev-env # omarchy:args= # omarchy:examples=omarchy install dev-env ruby | omarchy install dev-env node # omarchy:requires-sudo=true if [[ -z $1 ]]; then echo "Usage: omarchy-install-dev-env " >&2 exit 1 fi install_php() { mise tool-alias set php github:nunomaduro/static-php-builds mise use --global php@latest mise x php -- composer global config bin-dir "$HOME/.local/bin" } install_node() { echo -e "Installing Node.js...\n" mise use --global node } case "$1" in ruby) echo -e "Installing Ruby on Rails...\n" omarchy-pkg-add libyaml mise settings add ruby.compile false mise settings add idiomatic_version_file_enable_tools ruby mise use --global ruby@latest echo "gem: --no-document" >~/.gemrc mise x ruby -- gem install rails --no-document echo -e "\nYou can now run: rails new myproject" ;; node) install_node ;; bun) echo -e "Installing Bun...\n" mise use -g bun@latest ;; deno) echo -e "Installing Deno...\n" mise use -g deno@latest ;; go) echo -e "Installing Go...\n" mise use --global go@latest ;; php) echo -e "Installing PHP...\n" install_php ;; laravel) echo -e "Installing PHP and Laravel...\n" install_php install_node mise x php -- composer global require laravel/installer echo -e "\nYou can now run: laravel new myproject" ;; symfony) echo -e "Installing PHP and Symfony...\n" install_php omarchy-pkg-add symfony-cli echo -e "\nYou can now run: symfony new --webapp myproject" ;; python) echo -e "Installing Python...\n" mise use --global python@latest echo -e "\nInstalling uv...\n" curl -fsSL https://astral.sh/uv/install.sh | sh ;; elixir) echo -e "Installing Elixir...\n" mise use --global erlang@latest mise use --global elixir@latest mise x elixir -- mix local.hex --force ;; phoenix) echo -e "Installing Phoenix Framework...\n" # Ensure Erlang/Elixir first mise use --global erlang@latest mise use --global elixir@latest # Hex & Rebar mise x elixir -- mix local.hex --force mise x elixir -- mix local.rebar --force # Phoenix project (phx_new) mise x elixir -- mix archive.install hex phx_new --force echo -e "\nYou can now run: mix phx.new my_app" ;; rust) echo -e "Installing Rust...\n" bash -c "$(curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs)" -- -y ;; java) echo -e "Installing Java...\n" mise use --global java@latest ;; zig) echo -e "Installing Zig...\n" mise use --global zig@latest mise use -g zls@latest ;; ocaml) echo -e "Installing OCaml...\n" bash -c "$(curl -fsSL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)" opam init --yes eval "$(opam env)" opam install ocaml-lsp-server odoc ocamlformat utop --yes ;; dotnet) echo -e "Installing .NET...\n" mise use --global dotnet@latest ;; clojure) echo -e "Installing Clojure...\n" omarchy-pkg-add rlwrap mise use --global clojure@latest ;; scala) echo -e "Installing Scala...\n" mise use --global java@latest mise use --global scala@latest mise use --global scala-cli@latest ;; esac