- Install terminal.
- Install JetBrains Mono Nerd Font.
- Create SSH key:
ssh-keygen -t ed25519 -f "$HOME"/.ssh/magnusriga_ed25519
. - Add SSH key to
magnusriga
GitHub. - Add SSH key to agent:
ssh-add "$HOME"/.ssh/magnusriga_ed25519
. - Install
git
: a. Arch:sudo pacman -Syu git
b. Ubuntu:sudo apt update && sudo apt upgrade -y && sudo apt install -y git
. - Clone dotfiles:
git clone git@github.com:magnusriga/dotfiles.git "$HOME"/dotfiles
. - Clone nfront:
git clone git@github.com:magnusriga/nfront.git
. - Symlink SSH config:
ln -s "$HOME"/dotfiles/host/.ssh/config "$HOME"/.ssh/config
.
Pre-Requisites: Host Pre-Requisites
- Create user:
. ~/dotfiles/scripts/bootstrap.sh
. - Switch to new user:
nfu
. - Clone dotfiles:
git clone git@github.com:magnusriga/dotfiles.git "$HOME"/dotfiles
. - Re-run script to prepare machine:
. ~/dotfiles/scripts/bootstrap.sh
.
Pre-Requisites: Host Pre-Requisites
- Build and access:
. ~/dotfiles/host/docker/manage-container.sh -b [-t ubuntu]
. - Re-access:
ssh nfu-docker
. - Everything else is automatic.
Pre-Requisites: Host Pre-Requisites
-
Enter machine with default user:
orb -m <machine>
. -
Install
git
: a. Arch:sudo pacman -Syu git
b. Ubuntu:sudo apt -y modernize-sources && sudo apt update && sudo apt upgrade -y && sudo apt install -y git
. -
Clone dotfiles:
git clone git@github.com:magnusriga/dotfiles.git "$HOME"/dotfiles
. -
Create user:
. ~/dotfiles/scripts/bootstrap.sh
. -
Set socket permissions: a.
sudo chmod 766 /opt/orbstack-guest/run/*
b.sudo chmod 766 /opt/containerd
c. Must be re-run every time OrbStack restarts. d. Fixes ssh agent permission issues on new user. -
Switch to new user:
orb -m <machine> -u nfu
. -
Clone dotfiles:
git clone git@github.com:magnusriga/dotfiles.git "$HOME"/dotfiles
. -
Re-run script to prepare machine:
. ~/dotfiles/scripts/bootstrap.sh
. -
HOST: a. Create SSH keys:
ssh-keygen -t ed25519 -f ~/.ssh/<user>-<machine>_ed25519
b. Update SSH config:Host <user>-<machine> HostName 198.19.249.136 # From OrbStack Port 2222 User nfu IdentityFile ~/.ssh/<user>-<machine>_ed25519 ForwardAgent yes SendEnv TERM_PROGRAM SendEnv DISPLAY
c. Add SSH key to agent: ssh-add ~/.ssh/<user>-<machine>_ed25519
.
d. Test SSH connection, with password: ssh <user>-<machine>
.
e. Copy SSH key to container: ssh-copy-id -i ~/.ssh/<user>-<machine>_ed25519.pub <user>-<machine>
, with password nfu
.
f. Test SSH connection, with SSH agent: ssh <user>-<machine>
.
g. Copy terminfo to container: infocmp -x | ssh <user>-<machine> -- tic -x -
.
- General notes:
- Sometimes step (6) hangs first time, just try step (6) again.
- OrbStack Linux machine notes:
- SSH agent is forwarded automatically to Linux machine.
- Thus: Skip above steps 1-5 inside Linux machine.
- But: Still need above pre-requisites on host machine.
- Alternative: Use Docker container for easy setup, see below.
- If
ssh
fails:- Log in to server with
orb
. - Check permissions:
~/.ssh
has 700. - Check permissions:
~/.ssh/authorization_keys
has 600, created withssh-copy-id
. - Ensure SSH agent does not contain more keys than
MaxAuthTries
in/etc/ssh/sshd_config
, because SSH will never get to password prompt then.
- Log in to server with
- Start containers:
. ~/dotfiles/host/docker/manage-container.sh -u
. - Enter development container, either:
a.
ssh nfu-docker
. b.. ~/dotfiles/host/docker/manage-container.sh -s
.
- Docker swarm mode should not be used for development containers.
- Containers are recreated when host restarts.
- Therefore, do not use:
./.devcontainer/stack-build.sh -e dev
../.devcontainer/stack-deploy.sh -e dev
.
- Instead, use
docker compose build
anddocker compose up
.
- Transition
claude
to local install:yes | pnpm claude migrate-installer
. - Login to
claude
:claude
, then follow steps. - Login to
gh
:gh auth login
, then follow steps. - Login to
Copilot
in Neovim, for shadow-text, i.e. smart auto-complete:nvim
:Copilot auth
- Follow steps
- Not needed, automatic during
nfront
>pnpm i
. - Before:
- Add hooks to
.git/hooks
, by running:pre-commit install
- Run added hooks on all files:
pre-commit run --all-files
- Add hooks to
- Not setup yet.
- Build image from Linux (once):
./scripts/compose-build.sh -e prod
- Deploy stack from Linux (every time we run container):
./scripts/stack-deploy.sh -e prod
- Check by visiting: localhost
If git clone
does not work:
- Host:
ssh-add -L
, to check public key in ssh-agent. - Remote:
ssh-add -L
, to check it matches public key in ssh-agent in Host.
Other Notes
- Manually add name and email to
.gitconfig
:. ~/dotfiles/_unused/setup_git_credentials.sh
. - Prompt slightly delayed due to
git_status
, remove git status to avoid.