This repository aims at providing a simple way to (re)set a local environment.
Note: 607747a is the last revision relying on homemade scripts. Some of the existing configuration (e.g. screen, curl) have not been moved to the current setup.
The configuration files are managed via chezmoi.
References:
- Automating the Setup of a New Mac With All Your Apps, Preferences, and Development Tools for a good introduction, especially regarding templates.
- Managing dotfiles (see the script part)
MacOS tools are managed via Homebrew. We rely on the bundle feature (see Brewfile).
Notes:
- that this means applications should ideally be installed using App store (
masCLI) or brew cask to ensure reproducibility. - apps installed via App Store will be "frozen"
brew bundle dump --forcewill override an existingBrewfilewhich means that we cannot really add comments in the file: we therefore want to provide documentation when adding tools using dedicated commits.
Passwords, secrets, SSH keys are managed with 1password. For example, git signing is done using SSH key signing.
1password CLI is installed automatically via the Brewfile during chezmoi init --apply. Run eval $(op signin) before the final chezmoi apply to allow secrets to be read.
After installing the 1Password app, two settings must be enabled manually in Settings → Developer:
- CLI integration: allows
opto authenticate via the desktop app (no need foreval $(op signin)on subsequent runs) - SSH agent: allows 1Password to serve SSH keys to the system
chezmoi init marchelbling(marchelblingwill be expanded togithub.com/marchelbling/dotfiles.git)chezmoi cd: changes current directory to this repositorychezmoi apply: copieschezmoicurrent definitions to their home destinations
- Install mise:
curl https://mise.run | sh - Add mise to your shell (temporary, will be configured properly by chezmoi):
export PATH="$HOME/.local/bin:$PATH" eval "$(mise activate zsh)" # or bash
- Install the 1password application;
⚠️ ensure to activate the CLI and setup the SSH agent as without it,chezmoi initwill fail - Install chezmoi via mise:
mise use -g chezmoi
- Initialize and apply dotfiles (note that part of the setup will not be final in this stage as we need to install 1password cli):
chezmoi init --apply marchelbling
- Sign into 1Password CLI (installed in the previous step via Brewfile):
eval $(op signin)
- Finalize configuration:
chezmoi apply
Keymaps are documented in dot_config/nvim/KEYMAPS.md.
That file is generated, not hand-written: inside Neovim run
:KeymapsDocto regenerate it from the live mappings (defined in lua/config/keymaps_doc.lua).
Run it from a code buffer with your LSP attached so buffer-local LSP maps are captured.
Then persist the result into this repo:
chezmoi re-add ~/.config/nvim/KEYMAPS.md