Skip to content

Latest commit

 

History

History
64 lines (43 loc) · 2.16 KB

File metadata and controls

64 lines (43 loc) · 2.16 KB

Local development machine development environment setup with nix

⚠️ 🚨 ONLY PROCEED with the subsequent steps if ./setup-doughnut-dev.sh (see README.md) somehow failed horribly for you!!!

1. Install Nix

We use Nix installer by Determinate Systems to manage and ensure a reproducible development environment (https://determinate.systems/posts/determinate-nix-installer/).

Full details on Nix installation via Determinate nix-installer here

curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install --determinate

2. Setup and run doughnut for the first time (local development profile)

mkdir -p ~/.config/nix
echo 'experimental-features = nix-command flakes' >> ~/.config/nix/nix.conf

Launch a new terminal in your favourite shell (I highly recommend zsh). Clone full all-in-one doughnut codebase from Github (Microsoft Windows OS users, please clone the repo to a non-Windows mount directory)

git config --global core.autocrlf input
git clone git@github.com:nerds-odd-e/doughnut.git
git add --renormalize .

Boot up your doughnut development environment. MySQL DB server wil be started and initialised on entering the local cloned doughnut source directory via direnv else run nix develop.

cd doughnut

All development tool commands henceforth should work when in the nix development environment that will be bootstrapped by direnv (if installed and configured correctly), else run nix develop to get the necessary tooling installed correctly.

Start the complete development environment (recommended):

# from doughnut source root dir
pnpm sut

This starts backend, frontend, and mountebank - all with auto-reload on code changes.

Alternative - Start only the backend:

pnpm backend:sut

The backend will automatically restart when you change Java code. Navigate to README.md

3. Uninstalling

IF YOU REALLY REALLY NEED TO, you can remove Nix by running

/nix/nix-installer uninstall