Development environment setup and configuration management.
First-time setup:
./bootstrap.sh # First-time system setup
Daily usage:
# Quick rebuild of current config
nixswitch
# Full update (git + flake) and rebuild
nixup
bootstrap.sh
- First-time system setup (Xcode tools, Nix, Homebrew)build-nix.sh
- Core build script with options:- No flags: Just rebuild current config
--flake
(-f
): Update flake inputs and rebuild--git
(-g
): Pull latest changes and rebuild--update
(-u
): Full update (git + flake) and rebuild
.
├── bootstrap.sh # First-time setup
├── build-nix.sh # Core build script
├── nix/ # Nix configuration
│ ├── modules/ # System modules
│ └── flake.nix # Main flake
└── tools/ # Helper tools and scripts
- interactively: runp alias
- in scripts:
- option 1: direct path to python executable
- e.g. ~/.calmmage/dev_env/.venv/bin/python3 (should match the value of DEV_ENV_PATH)
- option 2: source ~/.zshrc and use runp alias
- todo: option 3 - add env vars to ~/.env and load them from there, then use DEV_ENV_PATH path
- option 1: direct path to python executable
- np (new project) alias - create a new project
- asd
- daily job to commit / push / pull all repos
- daily job to update all repos
- monthly job to process all repos, compile a list of all drafts
- open dir
- create dir link
- refresh dev env
- clone repo, create poetry env, using that env run
run.py
script What it does:
- clones dev_env repo to ~/.calmmage/dev_env
- sets up zshrc and aliases (add source to ~/.zshrc)
- sets up env variables STABLE_DEV_ENV_DIR, STABLE_VENV_PATH, ACTIVE_DEV_ENV_DIR and ACTIVE_VENV_PATH
- STABLE_DEV_ENV_DIR - "~/.calmmage/dev_env"
- STABLE_VENV_PATH - "~/.calmmage/dev_env/.venv"
- ACTIVE_DEV_ENV_DIR - this repo
- ACTIVE_VENV_PATH - this_repo/.venv
Notion page https://www.notion.so/Troubleshoot-throwaway-11fbc5d57f7c80a993eff1ccaa7c253e?pvs=4
- How to run python scripts with my dev env
- clone dev_env to
- Decide: to ~/work/projects or a separate location (e.g. ~/.calmmage)
- Decided. Clone to ~/.calmmage
- asd
- Option 1: just use direct path to python executable
- e.g. ~/.calmmage/dev_env/.venv/bin/python3
- Option 2: use my custom alias
runp
- It requires env variable $DEV_ENV_PATH to be set
- clone dev_env to
- How to set up a new dev env from scratch - or refresh it
- a) clone dev_env repo somewhere
- b) run setup.py script using
- How to look up/remember what I did in the past
- look at aliases and zshrc
- look at dev_env aliases and zshrc
- there's alias
help
andaliases
-
Нужен скрипт, который все разворачивает
- Изначально этот скрипт на питоне - как его запустить?
- Вариант 1 - пайчармом
- Вариант 2 - poetry install, poetry run
- dev_env/run.py
- Что делает скрипт?
- Скачивает dev_env в ~/.calmmage/dev_env
- Обновляет
- Кладет все нужное в ~/.zshrc если его там нет
- путь до dev_env
- путь до poetry env
- source dev_env/resources/shell_profiles/.zshrc
- source dev_env/resources/shell_profiles/aliases
- Скачивает dev_env в ~/.calmmage/dev_env
- Привязать скрипт к raycast setup_calmmage_dev_env
- Инструкция как настраивать raycast (может я ее уже писал? где-то…)
- extensions
- scripts
- Инструкция как настраивать raycast (может я ее уже писал? где-то…)
- Привязать к launchd чтобы daily гонялся-обновлялся
- Какой-то самодостаточный скрипт который может прогнаться даже если все сломано?
- install brew
- setup ssh keys
setup_ssh.sh - setup github cli
setup_gh.sh - install python environments
- clone all projects
- idea: daily job to commit / push / pull all repos
- create project structure
- setup zshrc and aliases
- raycast extensions
- launchd jobs
- add all utils to calmlib - to a beta section
- add all code snippets to calmapp / bot-lib - to a beta section
- add all code snippets to examples repo
- resolve 'migration' branches
- resolve leaked telegram token to a notion assistant repo
- resolve github tests failing - fix
Includes:
- Development Folder Structure
- .zshrc and aliases
- custom tools for manual and ad-hoc jobs
- Run main.py
- Add daily and monthly jobs to the automation tool of your choice (I use LaunchControl based on launchd for MacOs and n8n for Windows)
- to access github templates, add the GITHUB_API_TOKEN to the env variables or
.env
file
- Folder structure includes seasonal and structured folder,
cd_1
,cd_2
,cd_3
- You can access key folders using shortcut aliases- cd_1, cdl - ~/work/code/seasonal/latest
- cd_2, cdp - ~/work/playground
- cd_3, cds - ~/work/code/structured
help
- You can see key features in the $HELP env variable- project management
np
- create a new projectlt
- list available project templates