mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-02 19:32:43 +00:00
177 lines
9.2 KiB
Plaintext
177 lines
9.2 KiB
Plaintext
---
|
|
title: Externals and ignore rules
|
|
description: The git repos chezmoi clones into $HOME and every rule in .chezmoiignore.tmpl, including the role gate for the Linux desktop layer.
|
|
---
|
|
|
|
## .chezmoiexternal.toml [#externals]
|
|
|
|
Externals are content chezmoi fetches instead of storing in the repo. Every entry is a `git-repo` external: chezmoi runs `git clone` when the target directory is missing. Because they are real git checkouts, they are never symlinked into the source tree.
|
|
|
|
```toml .chezmoiexternal.toml
|
|
[".config/nvim"]
|
|
type = "git-repo"
|
|
url = "https://github.com/prdlk/nvim.git"
|
|
[".config/nvim".pull]
|
|
args = ["--ff-only"]
|
|
|
|
[".config/bat/syntaxes/sublime-purescript-syntax"]
|
|
type = "git-repo"
|
|
url = "https://github.com/tellnobody1/sublime-purescript-syntax.git"
|
|
[".config/bat/syntaxes/sublime-purescript-syntax".pull]
|
|
args = ["--ff-only"]
|
|
|
|
[".config/tmux/plugins/tpm"]
|
|
type = "git-repo"
|
|
url = "https://github.com/tmux-plugins/tpm.git"
|
|
[".config/tmux/plugins/tpm".pull]
|
|
args = ["--ff-only"]
|
|
```
|
|
|
|
| Target | Repo | Used by |
|
|
| --- | --- | --- |
|
|
| `~/.config/nvim` | [prdlk/nvim](https://github.com/prdlk/nvim) | Neovim config, kept in its own repo |
|
|
| `~/.config/bat/syntaxes/sublime-purescript-syntax` | [tellnobody1/sublime-purescript-syntax](https://github.com/tellnobody1/sublime-purescript-syntax) | PureScript syntax for bat, compiled into bat's cache by the [bat cache scripts](/chezmoi/scripts#build-bat-cache) |
|
|
| `~/.config/tmux/plugins/tpm` | [tmux-plugins/tpm](https://github.com/tmux-plugins/tpm) | tmux plugin manager, run from the bottom of `tmux.conf` ([tmux](/terminal/tmux)). Cloned inside the tmux checkout, whose `.gitignore` excludes `plugins/` |
|
|
|
|
### No refreshPeriod
|
|
|
|
No entry in `.chezmoiexternal.toml` sets `refreshPeriod`, so it stays at chezmoi's default of never. chezmoi clones each repo on a fresh machine and otherwise leaves it alone: `chezmoi apply` and `chezmoi update` do not pull. The local nvim checkout always wins over the remote, so in-progress Neovim edits and unpushed commits are never disturbed by an apply.
|
|
|
|
To update explicitly, run `chezmoi apply --refresh-externals` (`-R`), which pulls with `git pull --ff-only`. `--ff-only` makes the pull fail instead of creating a merge commit when the local checkout has diverged.
|
|
|
|
## .chezmoiexternals/ [#app-externals]
|
|
|
|
Per-app config repos, one file each in `.chezmoiexternals/<app>.toml`. Each is a `git-repo` external with `refreshPeriod = "168h"` and `pull.args = ["--ff-only"]`, so `chezmoi apply` fast-forwards them at most once a week. The repos hold plain config files (no chezmoi prefixes) and are not part of `chezmoi managed` contents.
|
|
|
|
```toml .chezmoiexternals/tmux.toml
|
|
[".config/tmux"]
|
|
type = "git-repo"
|
|
url = "https://github.com/prdlk/tmux.git"
|
|
refreshPeriod = "168h"
|
|
[".config/tmux".pull]
|
|
args = ["--ff-only"]
|
|
```
|
|
|
|
| File | Target | Repo |
|
|
| --- | --- | --- |
|
|
| `tmux.toml` | `~/.config/tmux` | [prdlk/tmux](https://github.com/prdlk/tmux) |
|
|
| `tmux-palette.toml` | `~/.config/tmux-palette` | [prdlk/tmux-palette](https://github.com/prdlk/tmux-palette) |
|
|
| `television.toml` | `~/.config/television` | [prdlk/television](https://github.com/prdlk/television) |
|
|
| `yazi.toml` | `~/.config/yazi` | [prdlk/yazi](https://github.com/prdlk/yazi) |
|
|
| `kitty.toml` | `~/.config/kitty` | [prdlk/kitty](https://github.com/prdlk/kitty) |
|
|
| `ghostty.toml` | `~/.config/ghostty` | [prdlk/ghostty](https://github.com/prdlk/ghostty) |
|
|
| `omarchy.toml` | `~/.config/omarchy` | [prdlk/omarchy](https://github.com/prdlk/omarchy) — `shell.json`, hooks, menu extensions, themed templates; git-installed themes/plugins are gitignored there and restored by its `install-extras` script, `calendars.json` is never committed |
|
|
| `noctalia.toml` | `~/.config/noctalia` | [prdlk/noctalia](https://github.com/prdlk/noctalia) — hand-written `config.toml` (shell, screenshot folder, theme, plugins, night light, notifications, OSD, wallpaper), `bar.toml` (bar layout, per-monitor overrides, widgets), and `palettes/` (custom palette JSON); merged under the GUI's unmanaged `~/.local/state/noctalia/settings.toml`, which wins on conflicts; `plugins/` holds runtime state with embedded tokens and is gitignored there. Linux desktop/laptop roles only ([role gate](#chezmoiignore)) |
|
|
|
|
Edit these in place under `~/.config/<app>`, then commit and push from that checkout.
|
|
|
|
## Submodules [#submodules]
|
|
|
|
Three source directories are git submodules, listed in `.gitmodules`. They keep chezmoi source naming and are applied in symlink mode like the rest of the tree. `chezmoi init` clones them.
|
|
|
|
| Source | Target | Repo |
|
|
| --- | --- | --- |
|
|
| `dot_config/niri` | `~/.config/niri` | [prdlk/niri](https://github.com/prdlk/niri) |
|
|
| `dot_config/hypr` | `~/.config/hypr` | [prdlk/hypr](https://github.com/prdlk/hypr) |
|
|
| `dot_config/fish` | `~/.config/fish` | [prdlk/fish](https://github.com/prdlk/fish) |
|
|
|
|
Edit them inside the submodule in the chezmoi source, commit there, then commit the updated submodule pointer in the root repo.
|
|
|
|
## .chezmoiignore.tmpl [#chezmoiignore]
|
|
|
|
Patterns match target paths (relative to `$HOME`). Matching entries are neither written nor removed. The file is a template, so the desktop block appears only on machines where it applies. Source entries that start with `.` (`.github/`, `.claude/`, `.crush/`, `.gitignore`) are ignored by chezmoi without needing a rule.
|
|
|
|
### Repo docs
|
|
|
|
```txt
|
|
MIGRATION-NOTES.md
|
|
README.md
|
|
CLAUDE.md
|
|
AGENTS.md
|
|
docs
|
|
.blume
|
|
node_modules
|
|
blume.config.ts
|
|
package.json
|
|
bun.lock
|
|
public
|
|
dist
|
|
```
|
|
|
|
Files at the source root that would otherwise land in `$HOME` as `~/README.md`, `~/docs`, `~/package.json`, and so on. This covers the repo README and agent instruction files, plus this Blume docs site and its build output.
|
|
|
|
### Runtime and plugin state inside managed trees
|
|
|
|
| Pattern | Why |
|
|
| --- | --- |
|
|
| `.config/lazygit/.omc/**` | Tool state written inside the lazygit config dir |
|
|
| `.config/tmux/plugins/**`, except `!.config/tmux/plugins/tpm` | Plugins tpm installs with `prefix I`; tpm itself is the external above |
|
|
| `.config/fish/fish_variables` | fish universal variables, rewritten by fish at runtime |
|
|
| `.config/fish/conf.d/secrets.fish` | Plaintext credentials. Local-only, never in git (the fish repo's `.gitignore` also lists it) |
|
|
| `.config/nvim/lazy-lock.json` | lazy.nvim lockfile inside the nvim external |
|
|
| `.config/nvim/.git`, `.config/nvim/.git/**` | The external's git metadata |
|
|
| `.config/nvim/.omc/**`, `.config/nvim/.crush/**`, `.config/nvim/.understand-anything/**` | Agent tool state inside the nvim checkout |
|
|
|
|
`.gitignore` covers the source side of the same problem: `dot_config/lazygit/dot_omc` and `__pycache__/` never get committed even though symlink mode lets tools write into the source tree.
|
|
|
|
### mise
|
|
|
|
```txt
|
|
.config/mise
|
|
.config/mise/**
|
|
```
|
|
|
|
mise tool versions stay local to each machine and are not managed.
|
|
|
|
### Linux desktop layer (role-gated)
|
|
|
|
```txt .chezmoiignore.tmpl
|
|
{{ if or (ne .chezmoi.os "linux") (and (ne .role "desktop") (ne .role "laptop")) }}
|
|
.config/niri
|
|
.config/niri/**
|
|
.config/hypr
|
|
.config/hypr/**
|
|
.config/umbriel
|
|
.config/umbriel/**
|
|
.config/uwsm
|
|
.config/uwsm/**
|
|
.config/noctalia
|
|
.config/noctalia/**
|
|
.config/vicinae
|
|
.config/vicinae/**
|
|
.config/niri-dynamic-workspaces
|
|
.config/niri-dynamic-workspaces/**
|
|
.config/fontconfig
|
|
.config/fontconfig/**
|
|
.config/mimeapps.list
|
|
.config/xdg-terminals.list
|
|
.config/systemd
|
|
.config/systemd/**
|
|
.local/bin/kitty-day-save
|
|
.local/bin/niri-launch
|
|
.local/bin/umbriel-launch
|
|
.local/bin/umbriel-smart-move
|
|
.config/fish/auto-Niri.fish
|
|
.local/bin/cp-appid
|
|
.local/bin/projects-sync
|
|
{{ end }}
|
|
```
|
|
|
|
The block is emitted, and these paths skipped, unless the OS is `linux` and the role is `desktop` or `laptop`. `mac` and `server` machines, and any non-Linux machine regardless of role, never receive the niri, Umbriel, and Hyprland configs (`dot_config/niri/`, `dot_config/umbriel/`, `dot_config/hypr/`), the Noctalia external (`~/.config/noctalia`, never cloned there), fontconfig (`dot_config/fontconfig/fonts.conf`), default-app associations (`dot_config/mimeapps.list`), the fish auto-start hook (`dot_config/fish/auto-Niri.fish`), the systemd user units (`dot_config/systemd/user/kitty-day-save.service`, `projects-sync.service`, `projects-sync.timer`), or the `niri-launch`, `umbriel-launch`, `umbriel-smart-move`, `cp-appid`, `kitty-day-save` and `projects-sync` scripts. The `niri-dynamic-workspaces` rule matches nothing in the current source tree; it only takes effect if that config is added later.
|
|
|
|
| Machine | Desktop layer |
|
|
| --- | --- |
|
|
| Linux, `desktop` or `laptop` | Applied |
|
|
| Linux, `server` or `mac` | Ignored |
|
|
| macOS or other OS, any role | Ignored |
|
|
|
|
See [Desktop](/desktop/niri) for what the layer contains. Gaps in the gate: the block lists `niri-launch` but not its siblings (`niri-launch-ai`, `niri-launch-browser`, `niri-launch-terminal`, `niri-launch-webapp`), and the waybar config (`dot_config/waybar/`) is not gated at all, so it applies on every role. `dot_config/niri/scripts/` is covered by `.config/niri/**`.
|
|
|
|
### Generated theme files
|
|
|
|
```txt
|
|
.config/umbriel/noctalia.toml
|
|
```
|
|
|
|
Noctalia's umbriel template rewrites this file on every theme change, so it stays out of the repo on every machine. `config.toml` includes it as an optional file; see [Umbriel](/desktop/umbriel#theme).
|