Declarative dotfiles for development on MacOS and Manjaro.
To provision a new workstation from scratch, use the setup.sh (or setup-linux.sh) script.
Run
bash <(curl -sL https://raw.githubusercontent.com/eliasnorrby/dotfiles/develop/setup.sh)Prepare to input your password a couple of times.
This setup script will:
- Install homebrew
- Install
python3andopenssl(usingbrew) - Download a snapshot version of this repo
- Install
ansible(usingbrew) - Install
ansiblerole dependencies - Run the downloaded playbook (
_provision/playbook.yml), wherein:- This repo is cloned to
~/.dotfiles - Symlinks are created
- xcode command line tools are installed (or verified to have been installed)
- Dependencies are downloaded (using
homebrew,pip,rubyandnpm)
- This repo is cloned to
- Run the post-install script, wherein:
zshplugins are installedvimplugins are installedcoc-nvimextensions are installedvscodeplugins are installeddoom-emacspackages are installed
π Estimated duration: ~45 minutes
Dependencies:
Configuration is divided into topics (inspired by
hlissner).
Example topics:
shell/zshshell/tmuxeditor/vim
Topics are grouped by category (editor, shell, etc). Each topic must contain
a topic.config.yml, and can optionally include a topic.tasks.yml, an
aliases.zsh, an env.zsh, as well as any other files relevant to its
configuration.
Ansible tasks defined in topic.tasks.yml will be run during provisioning.
Environment variables defined in env.zsh will be sourced during shell startup
if the topic is enabled. The same is true for aliases defined in aliases.zsh.
.dotfiles
βββ group
βββ topic
β βββ aliases.zsh
β βββ env.zsh
β βββ topic.config.yml
β βββ topic.tasks.yml
βββ another-topic
Minimal example of a topic directory layout
Extended directory layout example
.dotfiles
βββ editor
β βββ editorconfig
β β βββ topic.config.yml
β βββ emacs
β β βββ aliases.zsh
β β βββ topic.config.yml
β β βββ doom
β β β βββ config.el
β β β βββ init.el
β β β βββ packages.el
β β βββ env.zsh
β βββ vim
β βββ aliases.zsh
β βββ env.zsh
β βββ gvimrc.vim
β βββ topic.config.yml
βββ shell
βββ alacritty
β βββ alacritty.yml
β βββ aliases.zsh
β βββ topic.config.yml
βββ git
β βββ aliases.zsh
β βββ topic.config.yml
βββ tmux
β βββ aliases.zsh
β βββ env.zsh
β βββ scripts
β β βββ uptime-tmux-status.sh
β βββ tmux-cheatsheet.md
β βββ tmux.conf
β βββ tmux.remote.conf
β βββ tmux.theme.conf
β βββ topic.config.yml
βββ zsh
βββ aliases.zsh
βββ completion.zsh
βββ config.zsh
βββ fzf.zsh
βββ keybinds.zsh
βββ macos.zsh
βββ plugins.zsh
βββ prompt.zsh
βββ remote.zsh
βββ utilities.zsh
βββ topic.config.yml
βββ topic.tasks.yml
Each topic declares its configuration (brew dependencies, symlinks, etc) in a
topic.config.yml within its coresponding directory.
vim_config:
path: editor/vim
links:
- .vimrc
brew_formulae:
- vimTopic configuration example
Possible fields in topic.config.yml:
path(required)linksbecomebrew_formulaebrew_casksbrew_tapspacman_packagesaur_packagesosx_defaultsnpm_packagespip_packagesgem_packagesmas_apps
Each topic configuration is mapped to root.config.yml:
topics:
editor:
- name: vim
state: present
config: "{{ vim_config }}"
- name: emacs
state: present
config: "{{ emacs_config }}"
- name: editorconfig
state: disabled
config: "{{ editorconfig_config }}"
keyboard:
- name: hammerspoon
state: present
config: "{{ hammerspoon_config }}"
- name: karabiner
state: present
config: "{{ karabiner_config }}"
shell:
- name: tmux
state: present
config: "{{ tmux_config }}"
- name: zsh
state: present
config: "{{ zsh_config }}"
lang:
- name: java
state: present
config: "{{ java_config }}"
- name: go
state: absent
config: "{{ go_config }}"Root dotfile configuration example
In root.config.yml, topics can be enabled/disabled/removed by setting
their state to one of present, disabled or absent. Upon running,
presenttopics will have their symlinks created (if they don't exist already) and their dependencies installeddisabledtopics will have their symlinks removed (if they exist), but their dependencies left alone (if they are installed)absenttopics will have their symlinks removed (if they exist) and their dependencies uninstalled (if they are installed)
The CLI provides a simpler way to edit, view and apply configurations.
After running the provisioning script, there are a few things that need to be configured manually.
-
Set the computer name
- (MacOS) Preferences β Sharing
- (Linux)
sudo scutil --set HostName <name-you-want>
-
Generate ssh keys
ssh-keygen -t ed25519 -C "your_email@example.com" gh auth login -
Switch dotfiles remote to SSH
git -C ~/.dotfiles remote set-url origin git@github.com:eliasnorrby/dotfiles.git
- Start all apps and prepare to grant lots of privileges
- Start with Karabiner and Hammerspoon to enable app shortcuts
- Set main Raycast hotkey to β₯ + SPACE
- Set desktop background (assets available in Dropbox)
- Add additional desktops
- Enable shortcuts for desktop navigation (Preferences β Keyboard β Shortcuts β Mission Control)
- Remap layout switching shortcuts (Preferences β Keyboard β Shortcuts β Input Sources)
- Add Amethyst padding (
2 pxwindow margin,5 pxscreen padding) - Start Amethyst on Login (menubar configuration)
- Configure Bartender to hide the appropriate icons, supply license
- Import iStatMenus settings from
assets/istatmenus, supply license - Some apps may require Rosetta to run
/usr/sbin/softwareupdate --install-rosetta --agree-to-license
- Enable
atrun:sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.atrun.plist
- Download the Dank Mono font
It's probably mentioning /usr/local/share/zsh. Resolve it by running e.g:
sudo chown -R eliasnorrby:admin /usr/local/share/zsh
sudo chmod -R 755 /usr/local/share/zsh