Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ concurrency:

jobs:
test:
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 45

steps:
Expand All @@ -34,16 +38,38 @@ jobs:
echo "DOTFILES=$GITHUB_WORKSPACE" >> $GITHUB_ENV
ln -sf "$GITHUB_WORKSPACE" "$HOME/.dotfiles"

- name: Cache Homebrew packages
if: github.event_name != 'schedule' && !(github.event_name == 'workflow_dispatch' && inputs.skip_cache)
- name: Install Homebrew (Linux)
if: runner.os == 'Linux'
run: |
if ! command -v brew >/dev/null 2>&1; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
fi
echo "/home/linuxbrew/.linuxbrew/bin" >> "$GITHUB_PATH"

- name: Cache Homebrew packages (macOS)
if: runner.os == 'macOS' && github.event_name != 'schedule' && !(github.event_name == 'workflow_dispatch' && inputs.skip_cache)
uses: actions/cache@v4
with:
path: |
~/Library/Caches/Homebrew
/opt/homebrew/Cellar
/opt/homebrew/Library/Taps
key: brew-${{ hashFiles('macos/Brewfile') }}
restore-keys: brew-
key: brew-macos-${{ hashFiles('brew/Brewfile.common', 'brew/Brewfile.darwin') }}
restore-keys: brew-macos-

- name: Cache Homebrew packages (Linux)
if: runner.os == 'Linux' && github.event_name != 'schedule' && !(github.event_name == 'workflow_dispatch' && inputs.skip_cache)
uses: actions/cache@v4
with:
# Only cache downloads, not the installed Cellar: the runner ships a
# preinstalled Linuxbrew, and restoring cached kegs on top of it
# leaves them present-but-unregistered, which breaks `brew bundle`'s
# upgrade step ("File exists" / "No such keg"). Caching downloads
# still skips re-fetching bottles while installing cleanly each run.
path: |
~/.cache/Homebrew
key: brew-linux-v2-${{ hashFiles('brew/Brewfile.common') }}
restore-keys: brew-linux-v2-

- name: Install bats-core
run: |
Expand Down
48 changes: 41 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ before reinstalling everything from scratch...
1. save/backup all important documents from non-iCloud directories
1. save all your work from apps which aren't synced through iCloud
1. export important data from your local databases
1. update [mackup](https://github.com/lra/mackup) to the latest version and run `mackup backup`
1. update [mackup](https://github.com/lra/mackup) to the latest version and run `mackup backup` *(macOS only)*


## Installation

The `./install` script detects the platform (`uname`) and runs the right
combination of configs, so the first four steps are the same everywhere.

### macOS

```bash
# 1. Update macOS to the latest version with the App Store
sudo softwareupdate -i -a
Expand All @@ -31,7 +36,7 @@ chmod 600 <name_of_the_key>
# 3. Clone this repo to ~/.dotfiles
cd ~; git clone git@github.com:marcaube/dotfiles.git .dotfiles

# 4. Run install.sh to start the installation
# 4. Run the install script
cd ~/.dotfiles; ./install; cd -

# 5. Login with your Apple ID, check iCloud Drive and let it sync for a while
Expand All @@ -46,6 +51,28 @@ brew doctor
shutdown -r now
```

### Debian / Ubuntu Linux

The Apple-specific steps (App Store update, iCloud, `mackup`) don't apply.
`./install` installs the apt prerequisites it needs (build tools, `zsh`,
`xclip`/`wl-clipboard`, …) and Linuxbrew, then symlinks everything.

```bash
# 1. Update the system
sudo apt update && sudo apt upgrade

# 2. Copy your SSH keys to ~/.ssh and make sure they're set to 600
chmod 600 <name_of_the_key>

# 3. Clone this repo to ~/.dotfiles
cd ~; git clone git@github.com:marcaube/dotfiles.git .dotfiles

# 4. Run the install script
cd ~/.dotfiles; ./install; cd -

# 5. Log out and back in so the new login shell (zsh) takes effect
```


## Update

Expand All @@ -61,7 +88,7 @@ git pull
# 3. Reload the configs
reload

# 4. Restore preferences
# 4. Restore preferences (macOS only)
mackup restore
```

Expand All @@ -79,10 +106,14 @@ For example, that's where you could define your `GIT_AUTHOR_NAME` and

## Features

- cross-platform: works on macOS (Apple Silicon) and Debian/Ubuntu Linux — the
`./install` wrapper layers an OS-specific Dotbot config on top of a shared one,
and the shell config branches at runtime via `zsh/lib/os.zsh`
- sensible [`macos`](./macos/macos.sh) configs, see [this repo](https://github.com/kevinSuttle/MacOS-Defaults) for more options
- a [`Brewfile`](./macos/Brewfile) with a list of binaries and apps I use all the time, see [the caskroom](https://caskroom.github.io/search) for more
- binaries are installed with [Homebrew](http://brew.sh/)
- apps are either installed with Homebrew Cask or [MAS](https://github.com/mas-cli/mas)
- split Brewfiles: [`brew/Brewfile.common`](./brew/Brewfile.common) (cross-platform CLI tools) and
[`brew/Brewfile.darwin`](./brew/Brewfile.darwin) (macOS casks + Mac App Store apps), see [the caskroom](https://caskroom.github.io/search) for more
- binaries are installed with [Homebrew](http://brew.sh/) (Linuxbrew on Linux)
- apps are either installed with Homebrew Cask or [MAS](https://github.com/mas-cli/mas) (macOS only)
- an [`aliases.zsh`](./zsh/aliases.zsh) file with a bunch of useful aliases and functions
- CLI app launchers
- encoding and crypto utility functions
Expand All @@ -101,10 +132,13 @@ For example, that's where you could define your `GIT_AUTHOR_NAME` and
- [`macos.sh`](./macos/macos.sh) contains my macOS preferences
- [`zshrc`](./zsh/zshrc) contains my Z shell config (plugins are sourced directly, no Oh My ZSH)
- [`aliases.zsh`](./zsh/aliases.zsh) defines a list of useful CLI aliases, shortcuts and functions
- [`Brewfile`](./macos/Brewfile) contains the list of binaries (homebrew) and apps (cask and mas) that I want installed on my system
- [`brew/Brewfile.common`](./brew/Brewfile.common) and [`brew/Brewfile.darwin`](./brew/Brewfile.darwin) list the binaries (homebrew) and apps (cask and mas) I want installed
- [`exports.zsh`](./zsh/exports.zsh) contains the `PATH` env variable configs
- [`zsh/lib/os.zsh`](./zsh/lib/os.zsh) detects the platform and exposes `is_macos`/`is_linux` so the rest of the shell config can branch
- `zsh/aliases.darwin.zsh` / `zsh/aliases.linux.zsh` hold the platform-specific aliases (sourced as `aliases.${OS}.zsh`)
- `zsh/extra.zsh` is a file ignored by git where you can add your git credentials, custom commands, private aliases, etc.
- [`install`](./install) is the installation script to make this all work "automagically"
- `install.conf.common.yaml` plus `install.conf.darwin.yaml` / `install.conf.linux.yaml` are the [Dotbot](https://github.com/anishathalye/dotbot) configs
- [`init.lua`](./vim/init.lua) is my [Neovim](https://neovim.io/) entry point — modular config under `vim/lua/`, plugins managed by [lazy.nvim](https://github.com/folke/lazy.nvim)


Expand Down
73 changes: 4 additions & 69 deletions macos/Brewfile → brew/Brewfile.common
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Taps
tap 'remind101/formulae' # for assume-role
tap 'yqrashawn/goku' # For Goku
# Cross-platform Homebrew packages — work on both macOS and Linuxbrew.
# Bundled on every platform. macOS-only formulae, casks and MAS apps live in
# Brewfile.darwin.

# Install Binaries
# CLI utilities
brew 'atuin' # shell history on steroids
brew 'bat' # like 'cat', with highlighting, git support and pagination
brew 'coreutils' # Those that come with macOS are outdated
brew 'curl'
brew 'direnv' # Load/unload environment variables based on $PWD
brew 'docker-compose' # Docker without the hassle
Expand All @@ -16,21 +15,17 @@ brew 'fd' # a nicer 'find'
brew 'fzf' # Fuzzy search
brew 'gawk' # Like awk, but with a g. Not to be confused with the large bird of prey
brew 'git-delta' # Provides much better diffs highlighting in the terminal
brew 'gnu-sed' # sed, but a better version than what ships with OSX
brew 'graphviz' # graph/diagrams generation
brew 'htop'
brew 'httpie' # to test HTTP calls from the CLI
brew 'hyperfine' # a CLI benchmarking tool, to compare the performance of different commands
brew 'jc' # To convert the output of commands to json, pairs nicely with jq
brew 'jq' # When you want to manipulate JSON piped from httpie
brew 'mackup' # to sync my Mac configs
brew 'mas' # to install Mac App Store apps from the CLI
brew 'organize-tool' # file management automation tool
brew 'ouch' # easily compress/decompress files and directories
brew 'ripgrep' # like grep, but faster
brew 'rm-improved' # a better rm, with trash support
brew 'starship' # a minimalist CLI prompt
brew 'telnet'
brew 'tldr' # like 'man' but for lazy people with deadlines
brew 'tmux'
brew 'tmuxinator'
Expand All @@ -52,17 +47,9 @@ brew 'lazygit' # terminal UI for git
brew 'neovim' # the editor
brew 'tree-sitter-cli' # CLI used by nvim-treesitter (main) to build parsers

# Productivity and automation (see: https://tighten.com/blog/how-to-train-your-keyboard/)
cask 'karabiner-elements' # Remap keys and shortcuts at the kernel level
cask 'hammerspoon' # Take Karabiner's shortcuts and make the magic happen
cask 'handy' # Offline speech-to-text for dictating text and commands
brew 'yqrashawn/goku/goku' # Manage Karabiner configs with ease

# Tools for work
# brew 'assume-role'
# brew 'awscli'
# cask 'aws-vpn-client'
# cask 'session-manager-plugin'
# brew 'gettext' # to compile messages, don't forget to link!
# brew 'libjpeg'
# brew 'libmagic'
Expand All @@ -86,55 +73,3 @@ brew 'gdb' # the basic Binjitsu weapon
brew 'pngcheck'
brew 'sqlmap' # SQL injection
brew 'zbar' # barcode /qrcode reading
cask 'burp-suite'
cask 'hex-fiend' # a simple GUI hex editor

# Apps
cask '1password'
cask 'alfred'
cask 'anki' # flash cards, for learning and memorization (active recall, spaced repetition, etc)
cask 'caffeine' # when I don't want my computer to fall asleep
cask 'cleanshot' # Gorgeous, expansive (and expensive!) screeshot app
cask 'dash' # offline docs and code snippets FTW!
cask 'deckset' # slide decks for conference talks
cask 'docker-desktop'
cask 'firefox'
cask 'hiddenbar' # keep my statusbar tidy
cask 'heynote' # a nice scratchpad app
cask 'imagealpha' # optimize transparent PNGs
cask 'imageoptim' # optimize images
cask 'insomnia' # a nice API client GUI
cask 'pycharm'
cask 'kaleidoscope@2'
cask 'keybase'
cask 'keycastr' # when pairing remotely, to show all keypresses in vim/neovim
cask 'kitty'
cask 'ngrok'
cask 'obsidian'
cask 'rectangle' # no better ways to move windows around
cask 'slack'
cask 'sublime-text'
cask 'zoom'

# Gaming
cask 'battle-net'
cask 'discord'

# Quicklook
cask 'betterzip' # preview zip archives
cask 'qlmarkdown' # preview Markdown files
cask 'qlprettypatch' # preview diff patches
cask 'quicklook-csv' # preview CSV files

# Fonts
cask 'font-fira-code'
cask 'font-hack-nerd-font' # This font adds support for nice icons in NerdTree/NVIMTREE

# Install Mac App Store apps
mas 'Bear', id: 1091189122 # note taking app
mas 'Ivory', id: 6444602274 # Mastodon/Fediverse client
mas 'Next Meeting', id: 1017470484 # See what meeting is up next, right in the status bar
mas 'Pixelmator Pro', id: 1289583905
mas 'Reeder', id: 1529448980 # RSS reader
mas 'stts', id: 1187772509 # status of cloud services, right in the status bar
mas 'Vimari', id: 1480933944 # vim bindings for Safari
73 changes: 73 additions & 0 deletions brew/Brewfile.darwin
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# macOS-only Homebrew packages: casks, Mac App Store apps and formulae that
# only make sense on macOS. Bundled after Brewfile.common on macOS only.

# Taps
tap 'remind101/formulae' # for assume-role
tap 'yqrashawn/goku' # For Goku

# Formulae that ship natively on Linux or are macOS-specific
brew 'coreutils' # Those that come with macOS are outdated (Linux has GNU natively)
brew 'gnu-sed' # sed, but a better version than what ships with OSX
brew 'mackup' # to sync my Mac configs
brew 'mas' # to install Mac App Store apps from the CLI
brew 'telnet' # Homebrew's telnet formula is macOS-only; Linux gets it via apt

# Productivity and automation (see: https://tighten.com/blog/how-to-train-your-keyboard/)
cask 'karabiner-elements' # Remap keys and shortcuts at the kernel level
cask 'hammerspoon' # Take Karabiner's shortcuts and make the magic happen
cask 'handy' # Offline speech-to-text for dictating text and commands
brew 'yqrashawn/goku/goku' # Manage Karabiner configs with ease

# Pentesting / CTF / Forensics (GUI)
cask 'burp-suite'
cask 'hex-fiend' # a simple GUI hex editor

# Apps
cask '1password'
cask 'alfred'
cask 'anki' # flash cards, for learning and memorization (active recall, spaced repetition, etc)
cask 'caffeine' # when I don't want my computer to fall asleep
cask 'cleanshot' # Gorgeous, expansive (and expensive!) screeshot app
cask 'dash' # offline docs and code snippets FTW!
cask 'deckset' # slide decks for conference talks
cask 'docker-desktop'
cask 'firefox'
cask 'hiddenbar' # keep my statusbar tidy
cask 'heynote' # a nice scratchpad app
cask 'imagealpha' # optimize transparent PNGs
cask 'imageoptim' # optimize images
cask 'insomnia' # a nice API client GUI
cask 'pycharm'
cask 'kaleidoscope@2'
cask 'keybase'
cask 'keycastr' # when pairing remotely, to show all keypresses in vim/neovim
cask 'kitty'
cask 'ngrok'
cask 'obsidian'
cask 'rectangle' # no better ways to move windows around
cask 'slack'
cask 'sublime-text'
cask 'zoom'

# Gaming
cask 'battle-net'
cask 'discord'

# Quicklook
cask 'betterzip' # preview zip archives
cask 'qlmarkdown' # preview Markdown files
cask 'qlprettypatch' # preview diff patches
cask 'quicklook-csv' # preview CSV files

# Fonts
cask 'font-fira-code'
cask 'font-hack-nerd-font' # This font adds support for nice icons in NerdTree/NVIMTREE

# Install Mac App Store apps
mas 'Bear', id: 1091189122 # note taking app
mas 'Ivory', id: 6444602274 # Mastodon/Fediverse client
mas 'Next Meeting', id: 1017470484 # See what meeting is up next, right in the status bar
mas 'Pixelmator Pro', id: 1289583905
mas 'Reeder', id: 1529448980 # RSS reader
mas 'stts', id: 1187772509 # status of cloud services, right in the status bar
mas 'Vimari', id: 1480933944 # vim bindings for Safari
19 changes: 17 additions & 2 deletions install
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,29 @@

set -e

CONFIG="install.conf.yaml"
DOTBOT_DIR="git/submodules/dotbot"

DOTBOT_BIN="bin/dotbot"
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# Pick the OS-specific config to layer on top of the common one.
case "$(uname -s)" in
Darwin) OS_CONFIG="install.conf.darwin.yaml" ;;
Linux) OS_CONFIG="install.conf.linux.yaml" ;;
*) echo "Unsupported OS: $(uname -s)" >&2; exit 1 ;;
esac

cd "${BASEDIR}"
git -C "${DOTBOT_DIR}" submodule sync --quiet --recursive
git submodule update --init --recursive "${DOTBOT_DIR}"

"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" --plugin-dir git/submodules/dotbot-gh-extension -c "${CONFIG}" "${@}"
# Dotbot's -c takes a single config file, so merge the common and OS-specific
# configs (both are top-level YAML sequences) into one before running.
MERGED_CONFIG="$(mktemp)"
trap 'rm -f "${MERGED_CONFIG}"' EXIT
cat "install.conf.common.yaml" "${OS_CONFIG}" > "${MERGED_CONFIG}"

"${BASEDIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" -d "${BASEDIR}" \
--plugin-dir git/submodules/dotbot-gh-extension \
-c "${MERGED_CONFIG}" \
"${@}"
Loading
Loading