2023-11-07 03:06:44 +00:00
# System Setup
2023-10-06 23:35:07 +00:00
2023-11-07 03:06:44 +00:00
## prepare macOS
instructions may differ depending if you're on an intel mac or an apple silicon mac
2023-10-06 23:43:48 +00:00
2023-11-07 03:06:44 +00:00
not sure which you have? [follow this guide to find out. ](https://www.howtogeek.com/706226/how-to-check-if-your-mac-is-using-an-intel-or-apple-silicon-processor/ )
2023-10-06 23:37:34 +00:00
2023-11-07 03:06:44 +00:00
### install homebrew
```sh
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew update
brew install openssl git-lfs git zsh vscodium
```
2023-10-06 23:41:16 +00:00
2023-11-07 03:06:44 +00:00
## prepare windows
in an administrator powershell window: (press windows > type "powershell" > right click > run as administrator)
```powershell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
wsl --install -d Debian
```
2023-10-06 23:35:07 +00:00
2023-11-07 03:06:44 +00:00
then install [vscodium ](https://vscodium.com/#install ) (or [vscode ](https://code.visualstudio.com/Download ) if you prefer)
during install, there should be an "additional tasks > add vscode to PATH" option, this is strongly recommended.
2023-10-06 23:40:38 +00:00
2023-11-07 03:06:44 +00:00
### vscode in wsl mode
open vscode & install the [WSL vscode extension ](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl )
2023-10-06 23:35:07 +00:00
2023-11-07 03:06:44 +00:00
### set up wsl
in powershell:
```powershell
debian -u root
```
2023-10-06 23:35:07 +00:00
2023-11-07 03:06:44 +00:00
```sh
echo "installing packages"
apt-get update -y
apt-get upgrade -y
apt-get install -y git git-lfs libssl-devel curl wget man neovim zsh
echo "adding docker repo"
apt-get update
apt-get install ca-certificates curl gnupg
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg
echo "installing docker"
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release & & echo "$VERSION_CODENAME")" stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update -y
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
2023-10-06 23:35:07 +00:00
2023-11-07 03:06:44 +00:00
echo "installing postgresql"
apt install -y postgresql-common
/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
apt-get install -y postgresql-client-16
2023-10-06 23:37:34 +00:00
2023-11-07 03:06:44 +00:00
echo "changing default user to root, boot using systemd"
cat < < "EOF" > /etc/wsl.conf
[user]
default = root
2023-10-06 23:57:47 +00:00
2023-11-07 03:06:44 +00:00
[boot]
systemd=true
EOF
```
2023-10-07 00:36:55 +00:00
2023-11-07 03:06:44 +00:00
if that went well, close the window and in a powershell window:
```powershell
wsl --shutdown
```
2023-10-07 00:36:55 +00:00
2023-11-07 03:06:44 +00:00
then reopen `debian` and try running:
2023-10-07 00:36:55 +00:00
```sh
2023-11-07 03:06:44 +00:00
code .
2023-10-07 00:36:55 +00:00
```
2023-11-07 03:06:44 +00:00
a windows 10 VSCode window should open with "WSL: Debian" displayed in the far bottom left corner of the window
2023-10-07 00:36:55 +00:00
2023-11-07 03:06:44 +00:00
if this all went well, continue to [common ](#common ) and assume code snippets should be run in `debian` .
feel free to use VSCode in windows for terminal and file editing!
2023-10-07 00:36:55 +00:00
2023-11-07 03:06:44 +00:00
## common
2023-10-07 00:36:55 +00:00
```sh
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.13.1
2023-11-07 03:06:44 +00:00
cat < < "EOF" >> ~/.zshrc
source "$HOME/.asdf/asdf.sh"
source "$HOME/.asdf/completions/asdf.bash"
[ -s "~/.bun/_bun" ] & & source "~/.bun/_bun"
export BUN_INSTALL="~/.bun"
export PATH=$PATH:$HOME/.bun/bin
EOF
asdf plugin add python
asdf plugin add nodejs
2023-10-07 00:36:55 +00:00
asdf plugin add rust
asdf plugin add bun
asdf plugin add purescript
asdf install rust latest
asdf install bun latest
asdf install purescript latest
asdf global rust latest
asdf global bun latest
asdf global purescript latest
```
2023-11-07 03:06:44 +00:00
Done!