Compare commits
23 Commits
7acfbe686d
...
mac
| Author | SHA1 | Date | |
|---|---|---|---|
| b32d47884f | |||
| 707d6cffe8 | |||
| 61d1adb3f0 | |||
| 3a5e73a41e | |||
| 8cb7d0ef2c | |||
| cd52f62b81 | |||
| b9556c9ffb | |||
| 4b520d8ff3 | |||
| 32fa1a369b | |||
| d002786ad4 | |||
| bcd24b7c15 | |||
| 839b7e0b5f | |||
| 1f9cee1ad9 | |||
| 81540facfe | |||
| 7a121e3814 | |||
| d7f76aa1a9 | |||
| 3a82b9b170 | |||
| 3000fe9834 | |||
| de06d3ecb9 | |||
| a9d4518dfb | |||
| ef0d4c346c | |||
| 0cb38447fc | |||
| d2c5b35cc7 |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,2 +1,2 @@
|
|||||||
*nvim/lazy-lock.json*
|
*nvim/.config/nvim/lazy-lock.json*
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|||||||
@@ -28,3 +28,5 @@ _darcs
|
|||||||
scripts # scripts directory to be ignored
|
scripts # scripts directory to be ignored
|
||||||
shell # various shell configurations need not be stowed.
|
shell # various shell configurations need not be stowed.
|
||||||
.DS_store
|
.DS_store
|
||||||
|
README.md
|
||||||
|
.*/\.git
|
||||||
|
|||||||
80
README.md
80
README.md
@@ -2,10 +2,19 @@
|
|||||||
|
|
||||||
This repository contains my personal dotfiles, managed using [GNU Stow](https://www.gnu.org/software/stow/).
|
This repository contains my personal dotfiles, managed using [GNU Stow](https://www.gnu.org/software/stow/).
|
||||||
|
|
||||||
Instead of a custom installation script, configurations are organized into logical "packages". Using `stow` ensures that all configuration files are cleanly symlinked into your home directory, mirroring the structure inside the package folder.
|
Using `stow` ensures that all configuration files are cleanly symlinked into your home directory, mirroring the structure of this repository.
|
||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
|
A script is provided to help install the core dependencies across macOS and common Linux distributions (Ubuntu/Debian, Arch, Fedora).
|
||||||
|
|
||||||
|
To run the installation script:
|
||||||
|
```bash
|
||||||
|
./scripts/install_dependencies.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively, you can manually install the required tool:
|
||||||
|
|
||||||
- [GNU Stow](https://www.gnu.org/software/stow/)
|
- [GNU Stow](https://www.gnu.org/software/stow/)
|
||||||
|
|
||||||
To install Stow on macOS, use [Homebrew](https://brew.sh/):
|
To install Stow on macOS, use [Homebrew](https://brew.sh/):
|
||||||
@@ -27,52 +36,59 @@ sudo pacman -S stow
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
To install a specific package (e.g., `nvim`), navigate to the root of this repository and run:
|
To install all configurations at once, navigate to the root of this repository and run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
stow nvim
|
stow */
|
||||||
```
|
```
|
||||||
|
*(Note: Using `stow */` prevents the shell from passing pure files like `README.md` to Stow, ensuring only directory packages are stowed).*
|
||||||
|
|
||||||
To install all standard packages at once, run:
|
This will automatically create the necessary symlinks in your `$HOME` directory.
|
||||||
|
|
||||||
|
### Removing Configurations
|
||||||
|
|
||||||
|
If you want to remove the symlinks created by Stow, use the `-D` flag:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
stow bash zsh nvim starship tmux
|
stow -D */
|
||||||
```
|
```
|
||||||
|
|
||||||
This will automatically create the necessary symlinks in your `$HOME` directory pointing to the files in this repository.
|
## Directory Structure & Branching Strategy
|
||||||
|
|
||||||
### Removing a Package
|
This repository uses a **Folder-Per-App** structure combined with a **Git Branching Strategy** to flawlessly handle different machines (Mac, Work, Linux) without any `if/else` logic.
|
||||||
|
|
||||||
If you want to remove the symlinks for a specific package, use the `-D` flag:
|
### 1. Folder Structure
|
||||||
|
The root directories represent individual applications:
|
||||||
```bash
|
|
||||||
stow -D nvim
|
|
||||||
```
|
|
||||||
|
|
||||||
## Directory Structure
|
|
||||||
|
|
||||||
To keep things modular and easy to manage, each folder acts as a "package" that represents an application or environment. The folder structure *inside* the package strictly mirrors its target destination relative to the home (`~/`) directory.
|
|
||||||
|
|
||||||
```text
|
```text
|
||||||
.
|
.
|
||||||
├── bash/
|
├── bash/ # Stowed to ~ (contains .bashrc)
|
||||||
│ └── .bashrc # Symlinked to ~/.bashrc
|
├── nvim/ # Stowed to ~/.config/nvim/
|
||||||
├── nvim/
|
├── tmux/ # Stowed to ~ (contains .tmux.conf)
|
||||||
│ └── .config/
|
├── zsh/ # Stowed to ~ (contains .zshrc)
|
||||||
│ └── nvim/ # Symlinked to ~/.config/nvim/
|
└── ...
|
||||||
├── starship/
|
|
||||||
│ └── .config/
|
|
||||||
│ └── starship.toml # Symlinked to ~/.config/starship.toml
|
|
||||||
├── tmux/
|
|
||||||
│ ├── .tmux.conf # Symlinked to ~/.tmux.conf
|
|
||||||
│ └── .tmux.conf.local # Symlinked to ~/.tmux.conf.local
|
|
||||||
└── zsh/
|
|
||||||
└── .zshrc # Symlinked to ~/.zshrc
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 2. The Git Branch Workflow
|
||||||
|
This repository has zero conditional logic. Configurations are managed purely via branches.
|
||||||
|
|
||||||
|
- **`master` branch**: Contains the 95% common base configurations shared across all machines.
|
||||||
|
- **`mac`, `work`, `linux` branches**: Machine-specific branches derived from `master`.
|
||||||
|
|
||||||
|
**How to manage machine-specific settings:**
|
||||||
|
1. Check out your machine's branch (e.g., `git checkout work`).
|
||||||
|
2. Statically write your overrides (e.g., adding a Work-only plugin to `nvim/`).
|
||||||
|
3. Commit and push: `git push origin work`.
|
||||||
|
|
||||||
|
**How to update shared settings:**
|
||||||
|
1. Switch to the base branch: `git checkout master`.
|
||||||
|
2. Update the shared configuration and commit.
|
||||||
|
3. Switch back to your local branch: `git checkout work`.
|
||||||
|
4. Pull the updates in by rebasing: `git rebase master` (then `git push origin work -f`).
|
||||||
|
|
||||||
### Adding New Configurations
|
### Adding New Configurations
|
||||||
|
|
||||||
When you want to add a new tool:
|
When you want to add a new tool:
|
||||||
1. Create a new directory for it (e.g., `wezterm`).
|
1. Create a new folder matching the application's name (e.g., `mkdir alacritty`).
|
||||||
2. Replicate the target directory structure inside this new folder (e.g., `wezterm/.config/wezterm/wezterm.lua`).
|
2. Replicate the target directory structure inside it (e.g., `alacritty/.config/alacritty/alacritty.toml`).
|
||||||
3. Run `stow wezterm` from the root of this repository.
|
3. Run `stow */` from the root of this repository to link the new package.
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 694 KiB After Width: | Height: | Size: 694 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user