@leclabs/fleet 0.0.0-stage → 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +266 -2
- package/assets/dotfiles/atuin/config.toml +14 -0
- package/assets/dotfiles/ghostty/config.ghostty +13 -0
- package/assets/dotfiles/ghostty/themes/LexDark +31 -0
- package/assets/dotfiles/ghostty/themes/LexLight +29 -0
- package/assets/dotfiles/git/config +13 -0
- package/assets/dotfiles/starship.toml +82 -0
- package/assets/dotfiles/zshrc.zsh +35 -0
- package/assets/layers/base.toml +96 -0
- package/assets/layers/docker.toml +47 -0
- package/assets/layers/linux.toml +95 -0
- package/assets/layers/macos-x64.toml +36 -0
- package/assets/layers/macos.toml +163 -0
- package/assets/layers/nvidia.toml +49 -0
- package/dist/fleet.js +1343 -0
- package/install.sh +69 -0
- package/package.json +50 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lance Caraccioli
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,267 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @leclabs/fleet
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`fleet` applies one opinionated baseline to the host it runs on, with
|
|
4
|
+
`mise bootstrap` as its engine: the same shell, prompt, terminal, editor, apps
|
|
5
|
+
and commands on every host. It holds no ssh, no inventory and no hub: a host
|
|
6
|
+
applies the baseline to itself and keeps itself current on a daily timer.
|
|
7
|
+
|
|
8
|
+
Decision: [0011](../../design/decisions/0011-fleet-tool.md). What the baseline
|
|
9
|
+
learned the hard way: [LEARNINGS.md](LEARNINGS.md).
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
curl -fsSL https://raw.githubusercontent.com/leclabs/homelab/main/packages/fleet/install.sh | sh
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`install.sh` installs mise if it is absent (`curl https://mise.run | sh`), then
|
|
18
|
+
`mise use -g npm:@leclabs/fleet`, then runs `fleet init`. Flags after `--` go to
|
|
19
|
+
`fleet init`:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
curl -fsSL <url> | sh -s -- --icon 🔥 --layers docker
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- `FLEET_VERSION=<version>` pins a version; fleet follows `latest` otherwise.
|
|
26
|
+
- `FLEET_SOURCE=<path to a packed tarball>` installs that tarball instead of
|
|
27
|
+
the package from npm, to try a build before it is published.
|
|
28
|
+
|
|
29
|
+
Prerequisites on a minimal image: `curl`, `git` and `ca-certificates` for
|
|
30
|
+
`install.sh` and `fleet apply`, and `libatomic1` for the node that mise
|
|
31
|
+
installs. A desktop or server install has them; `fleet apply --machine`
|
|
32
|
+
installs git and libatomic1.
|
|
33
|
+
|
|
34
|
+
Then:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
fleet apply --machine # packages, system files, accounts: asks sudo
|
|
38
|
+
fleet apply # dotfiles, tools, shell, timer: your own user
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Either order works; the machine layer first installs what the user layer
|
|
42
|
+
links (bat, fd, zsh, git).
|
|
43
|
+
|
|
44
|
+
## host.toml
|
|
45
|
+
|
|
46
|
+
`~/.config/fleet/host.toml` holds what is this host's own. It stays on the host
|
|
47
|
+
and never goes in a repository. `fleet init` creates it; every key is
|
|
48
|
+
validated, and an unknown key is an error.
|
|
49
|
+
|
|
50
|
+
| Key | Value | Effect |
|
|
51
|
+
| ----------- | ------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
|
|
52
|
+
| `icon` | one emoji with emoji presentation (no variation selector, so 🔥, not ❤️) | The prompt shows it before the host name. Default 💻. |
|
|
53
|
+
| `wallpaper` | an http(s) URL, or a path: absolute or under `~/` | Applied by `fleet apply` on GNOME and macOS; a URL is downloaded once to `~/.local/share/fleet/wallpaper`. |
|
|
54
|
+
| `layers` | a list of opt-in layers: `nvidia`, `docker` | The layers this host adds to the baseline. |
|
|
55
|
+
|
|
56
|
+
```toml
|
|
57
|
+
icon = "🔥"
|
|
58
|
+
wallpaper = "https://example.com/forge.jpg"
|
|
59
|
+
layers = ["nvidia", "docker"]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The OS layers are never listed: `linux` on Linux, `macos` on macOS, and
|
|
63
|
+
`macos-x64` as well on an Intel Mac. A layer the host cannot take (`docker` or
|
|
64
|
+
`nvidia` on macOS, `nvidia` on arm64) is an error, not a silent omission.
|
|
65
|
+
|
|
66
|
+
## Layers
|
|
67
|
+
|
|
68
|
+
fleet renders each layer as a folder fragment under
|
|
69
|
+
`~/.config/mise/conf.d/fleet-<layer>/`, and writes `fleet-host/` for what
|
|
70
|
+
depends on the account. Folders named `fleet-*` are fleet's to rewrite on every
|
|
71
|
+
run, and fleet removes the one of a layer the host dropped; every other file in
|
|
72
|
+
`~/.config/mise`, `config.toml` and your own `conf.d` fragments included, is
|
|
73
|
+
yours and left alone.
|
|
74
|
+
|
|
75
|
+
| Layer | When | Holds |
|
|
76
|
+
| ----------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
77
|
+
| `base` | every host | CLI toolkit, runtimes, git, containers (podman), the shell, prompt, terminal and editor dotfiles, and the installers of Claude Code and omp |
|
|
78
|
+
| `linux` | Linux | apt sources and packages, apps from snap and flatpak, pnpm's home, the self-update timer |
|
|
79
|
+
| `macos` | macOS | casks, the GNU userland under g-names, the Command Line Tools, the Dock, pointer and shortcuts, the self-update agent |
|
|
80
|
+
| `macos-x64` | Intel Mac | the formulae mise's brew manager skips on Intel, from their vendors' release builds |
|
|
81
|
+
| `nvidia` | `layers` lists it | the driver Ubuntu recommends for the GPU, NVIDIA's container toolkit, a visible boot menu; Linux x64 |
|
|
82
|
+
| `docker` | `layers` lists it | Docker Engine, the CLI, containerd, the buildx and Compose plugins from Docker's apt repository; the user in group `docker`; `/etc/docker/daemon.json` with `"log-driver": "local"`; Linux |
|
|
83
|
+
|
|
84
|
+
## Commands
|
|
85
|
+
|
|
86
|
+
| Command | What it does |
|
|
87
|
+
| -------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
88
|
+
| `fleet init` | Creates `host.toml`, or completes the one there. Asks only what it cannot detect, and only on a terminal. Flags: `--icon`, `--wallpaper`, `--layers`. |
|
|
89
|
+
| `fleet config get <key>` | Prints a key; a list prints comma-separated. Exits 1 when the key is not set. |
|
|
90
|
+
| `fleet config set <key> [value]` | Sets a key, or removes it when no value is given. `layers` takes a comma-separated list. The file is written only when the result is valid. |
|
|
91
|
+
| `fleet apply` | The user layer. Renders the layers, saves and replaces the files it owns, runs the user parts of `mise bootstrap`, then applies the wallpaper. `--dry-run` writes nothing and shows the changes; `--upgrade` also upgrades the tools. |
|
|
92
|
+
| `fleet apply --machine` | The machine layer: the parts that need root. fleet asks sudo to run itself (`sudo <node> <fleet> apply --machine`), so the sudo on a stock Ubuntu, whose PATH holds no mise node, is enough. Also runs as `sudo fleet apply --machine` where fleet is on root's PATH. `--dry-run` shows the changes, `--upgrade` also upgrades the packages. |
|
|
93
|
+
| `fleet update` | Upgrades the fleet package through mise (`mise upgrade npm:@leclabs/fleet`), then mise (`mise self-update`). A mise that cannot update itself warns. |
|
|
94
|
+
| `fleet verify` | The acceptance check: exits 0 when the host matches the baseline, 1 naming each failure. Writes nothing. `--json` prints the report as one JSON object. See [The acceptance check](#the-acceptance-check). |
|
|
95
|
+
|
|
96
|
+
## The acceptance check
|
|
97
|
+
|
|
98
|
+
`fleet verify` passes when:
|
|
99
|
+
|
|
100
|
+
1. Every entry of `mise bootstrap status --json`, the report `mise bootstrap
|
|
101
|
+
status --missing` exits on, is in an applied state: a package, tool,
|
|
102
|
+
repository, dotfile or shell block `installed`, `applied` or `current`, the
|
|
103
|
+
login shell `set`, a unit running as declared, a file, account or service
|
|
104
|
+
with nothing planned. Anything else (`missing`, `differs`, `dirty`,
|
|
105
|
+
`conflict`, `unknown`) fails, named. The account's `~/.config/mise` holds
|
|
106
|
+
both layers, so a host that has had `fleet apply` but not `fleet apply
|
|
107
|
+
--machine` fails here, naming the missing packages. Only `skipped` entries
|
|
108
|
+
are exempt: mise skips what the host cannot take (no snap or systemd user
|
|
109
|
+
manager in a container; on an Intel Mac, the formulae mise's brew manager
|
|
110
|
+
skips, whose replacements the `macos-x64` layer declares as tools).
|
|
111
|
+
2. Every command a declared package or tool provides resolves, symlinks
|
|
112
|
+
followed, to that package or tool in an interactive shell (`zsh -ic`), a
|
|
113
|
+
login shell (`zsh -lc`) and a non-interactive one (`zsh -c`, the shell
|
|
114
|
+
`ssh <host> <command>` gets). Each runs with the base `PATH` sshd hands a
|
|
115
|
+
shell, so what resolves is what the startup files give. A mise shim counts
|
|
116
|
+
as the tool `mise which` names. The commands of Claude Code and omp must
|
|
117
|
+
resolve under `~/.local`; Ubuntu's `batcat` and `fdfind` are also expected
|
|
118
|
+
under their upstream names, `bat` and `fd`.
|
|
119
|
+
3. No alias or function hides a command; `ls`, `cat`, `top`, `stat`, `sed`,
|
|
120
|
+
`date`, `grep` and `awk` run the OS's own program (`/usr/bin` or `/bin`);
|
|
121
|
+
and the interactive shell starts without writing to stderr.
|
|
122
|
+
4. Where the `nvidia` layer is on, the driver Ubuntu recommends is installed and
|
|
123
|
+
its version is the loaded kernel module's (`/proc/driver/nvidia/version`); a
|
|
124
|
+
mismatch, which a reboot resolves, fails.
|
|
125
|
+
|
|
126
|
+
It warns, and still passes, for:
|
|
127
|
+
|
|
128
|
+
- a second copy of a declared tool on `PATH` (copies in the OS's directories and
|
|
129
|
+
mise's shims are not reported);
|
|
130
|
+
- a second `mise activate` outside mise's managed blocks;
|
|
131
|
+
- any other line in `~/.zshenv`, `~/.zprofile`, `~/.zshrc`, `~/.zlogin`,
|
|
132
|
+
`~/.bashrc`, `~/.bash_profile` or `~/.profile`, outside mise's managed
|
|
133
|
+
blocks, that changes `PATH` or loads a tool's setup, such as rustup's
|
|
134
|
+
`. "$HOME/.cargo/env"`. A line the OS's own skeleton file (`/etc/skel`) has is
|
|
135
|
+
the OS's, and comments and other lines you add are not reported.
|
|
136
|
+
|
|
137
|
+
Each line names the failure; warnings come first, marked `!`, then failures,
|
|
138
|
+
marked `✗`, then a count:
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
! [login] another node behind the declared one: /home/ada/.cargo/bin/node -> ...
|
|
142
|
+
✗ [interactive] sed is an alias hiding the declared command
|
|
143
|
+
✗ mise bootstrap status differs from the baseline:
|
|
144
|
+
tools yq missing
|
|
145
|
+
118 commands checked, 2 failures, 1 warnings
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
With `--json` the report is one object: `ok`, `commands` (how many were
|
|
149
|
+
checked), and `failures` and `warnings`, each a list of `{ "check", "message" }`
|
|
150
|
+
where `check` is `bootstrap`, `resolution`, `shell`, `gpu` or `startup`. A check
|
|
151
|
+
that cannot run (mise is not installed) is reported the same way, on stdout,
|
|
152
|
+
with `commands` 0 and `check` `error`. The exit code is the same: 0 when all
|
|
153
|
+
pass, 1 otherwise.
|
|
154
|
+
|
|
155
|
+
## The user and machine split
|
|
156
|
+
|
|
157
|
+
`mise bootstrap` applies its parts in a fixed order (`mise bootstrap --help`,
|
|
158
|
+
[Bootstrap](https://mise.jdx.dev/bootstrap.html)). fleet hands each scope an
|
|
159
|
+
explicit `--only` list, so a part mise adds later is in neither scope until
|
|
160
|
+
someone places it. The split follows what each part changes, from mise's pages
|
|
161
|
+
for it:
|
|
162
|
+
|
|
163
|
+
| Scope | Parts | Why |
|
|
164
|
+
| ------- | ---------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
165
|
+
| user | `plugins`, `repos`, `dotfiles`, `mise-shell-activate`, `tools`, `settings`, `task` | They write the account's home and mise's own directories. |
|
|
166
|
+
| user | `macos-defaults`, `macos-launchd-agents`, `linux-systemd-units` | Preferences, LaunchAgents and `systemctl --user` units belong to the user; [systemd user units](https://mise.jdx.dev/bootstrap/systemd.html) run as you. |
|
|
167
|
+
| machine | `accounts` | `useradd`, `groupadd` and `dscl` need root ([accounts](https://mise.jdx.dev/bootstrap/accounts.html)). |
|
|
168
|
+
| machine | `files` | System files and directories with an owner, under `/etc` ([files](https://mise.jdx.dev/bootstrap/files.html)). |
|
|
169
|
+
| machine | `packages` | apt and snap need root; Homebrew creates its prefix with sudo, and casks may need it ([packages](https://mise.jdx.dev/bootstrap/packages/)). Hooks `pre-packages` and `post-packages` run here. |
|
|
170
|
+
| machine | `services`, `firewall` | System services and the host firewall need root. |
|
|
171
|
+
| machine | `user` | The login shell: mise adds it to `/etc/shells`, then runs `chsh` for `SUDO_USER` ([shell](https://mise.jdx.dev/bootstrap/shell.html)). |
|
|
172
|
+
| machine | `macos-launchd-daemons`, `final-hook` | LaunchDaemons run as root; the `final` hook regenerates the boot menu on an NVIDIA host. |
|
|
173
|
+
| neither | `compose`, `ssh` | Left out on purpose: the baseline declares no Compose project and no ssh trust (fleet holds no inventory and no hub). |
|
|
174
|
+
|
|
175
|
+
Three settings keep the scopes apart:
|
|
176
|
+
|
|
177
|
+
- The user run sets `MISE_SYSTEM_PACKAGES_SUDO=false`, so a step that needs root
|
|
178
|
+
fails there instead of asking for a password. A timer never blocks on one.
|
|
179
|
+
- The machine run sets `MISE_SYSTEM_PACKAGES_MANAGERS` to `apt,snap` on Linux
|
|
180
|
+
and `brew,brew-cask` on macOS, so `flatpak-user` apps install for the user in
|
|
181
|
+
the user run and never for root.
|
|
182
|
+
- Both runs read the account's `~/.config/mise` through `MISE_CONFIG_DIR`, so
|
|
183
|
+
`fleet apply --machine` configures the account that ran it, not root. What
|
|
184
|
+
root writes there is handed back to that account.
|
|
185
|
+
|
|
186
|
+
On macOS the machine run's Homebrew steps rely on mise's own handling of
|
|
187
|
+
`sudo mise` (the prefix belongs to `SUDO_USER`); that path is not yet exercised
|
|
188
|
+
on a Mac.
|
|
189
|
+
|
|
190
|
+
`mise bootstrap` accepts 20 parts, and fleet pins them in one list
|
|
191
|
+
(`BOOTSTRAP_PARTS`): ten are the user's, eight the machine's, two left out. A
|
|
192
|
+
test holds the three lists disjoint and equal to it.
|
|
193
|
+
|
|
194
|
+
## Files fleet owns
|
|
195
|
+
|
|
196
|
+
The user layer links these files from the baseline, and replaces whatever the
|
|
197
|
+
host holds there:
|
|
198
|
+
|
|
199
|
+
- `~/.config/git/config`
|
|
200
|
+
- `~/.config/starship.toml`
|
|
201
|
+
- `~/.config/atuin/config.toml`
|
|
202
|
+
- `~/.config/ghostty/config.ghostty`
|
|
203
|
+
- `~/.config/ghostty/themes/LexLight` and `~/.config/ghostty/themes/LexDark`
|
|
204
|
+
|
|
205
|
+
`fleet apply` always takes them over, so the unattended timer never stalls on a
|
|
206
|
+
file of yours. It saves each file it replaces first, as it was, under
|
|
207
|
+
`~/.local/share/fleet/backups/<UTC time>/`, at its path relative to your home,
|
|
208
|
+
and prints where. To get one back, copy it over the link:
|
|
209
|
+
|
|
210
|
+
```sh
|
|
211
|
+
rm ~/.config/git/config
|
|
212
|
+
cp -a ~/.local/share/fleet/backups/<UTC time>/.config/git/config ~/.config/git/config
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
fleet takes the path over again on its next run, so a setting worth keeping
|
|
216
|
+
goes where the tool reads a second file. `mise bootstrap --force-dotfiles`
|
|
217
|
+
itself keeps no copy, which is why fleet saves them.
|
|
218
|
+
|
|
219
|
+
Your own settings go where the tool reads a second file, so fleet never meets
|
|
220
|
+
them:
|
|
221
|
+
|
|
222
|
+
- git: `~/.gitconfig`, which git reads after `~/.config/git/config`. The
|
|
223
|
+
baseline sets no `user.name` or `user.email`; set yours there.
|
|
224
|
+
- Shell startup files (`~/.zshrc`, `~/.zshenv`, `~/.zprofile`): fleet writes
|
|
225
|
+
only between its `# >>> mise:… >>>` markers; your lines outside them stay.
|
|
226
|
+
- Anything else in `~/.config/mise`: `config.toml`, `config.local.toml` and
|
|
227
|
+
your own `conf.d` fragments, which fleet never rewrites.
|
|
228
|
+
|
|
229
|
+
A real file where fleet only links a command (`~/.local/bin/bat`, `fd`) is left
|
|
230
|
+
alone.
|
|
231
|
+
|
|
232
|
+
## Self-update
|
|
233
|
+
|
|
234
|
+
`fleet apply` declares a daily timer that runs `fleet update && fleet apply
|
|
235
|
+
--upgrade` as the user, so a host stays current, not only converged:
|
|
236
|
+
`dev.mise.fleet-update-daily.timer` (it runs `dev.mise.fleet-update.service`)
|
|
237
|
+
through `[bootstrap.linux.systemd.units]` on Linux, and a
|
|
238
|
+
`dev.mise.fleet-update` LaunchAgent at 04:00 on macOS. So the
|
|
239
|
+
user layer installs its own updater, and the timer needs no root. On a server
|
|
240
|
+
without a login session, `sudo loginctl enable-linger $USER` keeps the user's
|
|
241
|
+
systemd manager, and so the timer, running. The machine layer is not on the
|
|
242
|
+
timer: it runs when the operator runs `fleet apply --machine`, with
|
|
243
|
+
`--upgrade` to upgrade the packages too.
|
|
244
|
+
|
|
245
|
+
On a host with no systemd user manager (a container), mise skips the units and
|
|
246
|
+
ends its run with a follow-up note.
|
|
247
|
+
|
|
248
|
+
## Development
|
|
249
|
+
|
|
250
|
+
```sh
|
|
251
|
+
pnpm check # build, lint, typecheck, tests: the one check
|
|
252
|
+
packages/fleet/test/container.sh # the user layer in an ubuntu:26.04 container
|
|
253
|
+
packages/fleet/test/container.sh --systemd # ... with systemd, so the timer installs too; then both layers and fleet verify
|
|
254
|
+
packages/fleet/test/container.sh --machine # the machine layer with docker, as a sudo user, then fleet verify
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
`test/container.sh` needs podman and the network. It packs the package and runs
|
|
258
|
+
in a fresh `ubuntu:26.04` container. The first two install the prerequisites as
|
|
259
|
+
root, then run `install.sh` and `fleet apply` as a user with no sudo, once on a
|
|
260
|
+
home that already holds a `~/.config/git/config` of its own. `--machine` boots
|
|
261
|
+
systemd and gives the user sudo, runs `fleet apply --machine` with the docker
|
|
262
|
+
layer, and checks docker-ce is installed, the user is in `docker`, and
|
|
263
|
+
`/etc/docker/daemon.json` sets the `local` log driver. `--machine` then
|
|
264
|
+
applies the user layer and checks that `fleet verify` passes on the whole
|
|
265
|
+
baseline, docker's commands and services included, and fails once a declared
|
|
266
|
+
tool (yq) is removed, naming it. The `--systemd` run does the same with the
|
|
267
|
+
machine layer applied as root without docker.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# atuin on its upstream defaults except the three settings below. History is
|
|
2
|
+
# local to each host; no host logs in to a sync server.
|
|
3
|
+
# Reference: https://docs.atuin.sh/configuration/config/
|
|
4
|
+
|
|
5
|
+
## Enter runs the selected command; Tab returns it to the prompt for editing.
|
|
6
|
+
enter_accept = true
|
|
7
|
+
|
|
8
|
+
## mise owns atuin's version, so atuin's own release check would only nag.
|
|
9
|
+
## With it off, atuin makes no update-check network requests.
|
|
10
|
+
update_check = false
|
|
11
|
+
|
|
12
|
+
## Select a result with Ctrl-0..9 instead of Alt-0..9: Ghostty binds Alt-1..9 to
|
|
13
|
+
## tabs on Linux, and macOS has no Alt key, so Ctrl works the same everywhere.
|
|
14
|
+
ctrl_n_shortcuts = true
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# JetBrains Mono comes from each OS's own channel; the Nerd Font symbols the
|
|
2
|
+
# prompt draws are built into Ghostty, so no patched font is needed.
|
|
3
|
+
font-family = JetBrains Mono
|
|
4
|
+
font-size = 14
|
|
5
|
+
# The system appearance picks the theme; naming one theme alone pins it. The
|
|
6
|
+
# prompt names terminal colors, so it follows whichever theme is drawn.
|
|
7
|
+
theme = light:LexLight,dark:LexDark
|
|
8
|
+
window-padding-x = 10
|
|
9
|
+
window-padding-y = 10
|
|
10
|
+
shell-integration = zsh
|
|
11
|
+
# Ghostty's TERM is xterm-ghostty; ssh-terminfo installs that entry on each host
|
|
12
|
+
# it connects to, so remote prompts and line wrapping render correctly.
|
|
13
|
+
shell-integration-features = ssh-terminfo
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# LexDark — Ghostty's theme when the system appearance is dark; LexLight is its
|
|
2
|
+
# light pair. Each hue at its OWN gamut-cusp lightness (max chroma = most vivid /
|
|
3
|
+
# "truest" form) for the normal band; only blue, unreadable at its cusp
|
|
4
|
+
# (#0037ff), is lightened at the same hue to #3f78ff. The bright band sits about
|
|
5
|
+
# halfway to white at the same hue, so each bright color keeps its hue and stays
|
|
6
|
+
# apart from the foreground. Black is true black, bright black a muted grey at
|
|
7
|
+
# 3:1 on the background, and the foreground the bright white, so no hue doubles
|
|
8
|
+
# as plain text and no color vanishes into the background.
|
|
9
|
+
palette = 0=#000000
|
|
10
|
+
palette = 1=#ff0000
|
|
11
|
+
palette = 2=#00ff00
|
|
12
|
+
palette = 3=#ffff00
|
|
13
|
+
palette = 4=#3f78ff
|
|
14
|
+
palette = 5=#ff00ff
|
|
15
|
+
palette = 6=#00ffff
|
|
16
|
+
palette = 7=#bfe6bf
|
|
17
|
+
palette = 8=#657365
|
|
18
|
+
palette = 9=#ff8473
|
|
19
|
+
palette = 10=#80ff80
|
|
20
|
+
palette = 11=#ffff80
|
|
21
|
+
palette = 12=#8db2ff
|
|
22
|
+
palette = 13=#ff9afb
|
|
23
|
+
palette = 14=#80ffff
|
|
24
|
+
palette = 15=#f2fff2
|
|
25
|
+
background = #262626
|
|
26
|
+
foreground = #f2fff2
|
|
27
|
+
cursor-color = #00ff00
|
|
28
|
+
cursor-text = #262626
|
|
29
|
+
selection-background = #4c594c
|
|
30
|
+
selection-foreground = #f2fff2
|
|
31
|
+
split-divider-color = #ff00ff
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# LexLight — Ghostty's theme when the system appearance is light; LexDark is its
|
|
2
|
+
# dark pair. omp's built-in `light` theme as a terminal theme: background,
|
|
3
|
+
# foreground and the 16 ANSI colors are its `terminal` section; cursor, selection
|
|
4
|
+
# and split divider take its accent (#5a8080), selectedBg (#d0d0e0) and
|
|
5
|
+
# borderMuted (#b0b0b0). omp then draws on the surface its light theme was made
|
|
6
|
+
# for.
|
|
7
|
+
palette = 0=#000000
|
|
8
|
+
palette = 1=#cd3131
|
|
9
|
+
palette = 2=#107c10
|
|
10
|
+
palette = 3=#919514
|
|
11
|
+
palette = 4=#0451a5
|
|
12
|
+
palette = 5=#bc05bc
|
|
13
|
+
palette = 6=#0598bc
|
|
14
|
+
palette = 7=#555555
|
|
15
|
+
palette = 8=#666666
|
|
16
|
+
palette = 9=#f14c4c
|
|
17
|
+
palette = 10=#09a60a
|
|
18
|
+
palette = 11=#919516
|
|
19
|
+
palette = 12=#3b8eea
|
|
20
|
+
palette = 13=#ce68ce
|
|
21
|
+
palette = 14=#1a9cba
|
|
22
|
+
palette = 15=#a5a5a5
|
|
23
|
+
background = #f8f8f8
|
|
24
|
+
foreground = #3b3b3b
|
|
25
|
+
cursor-color = #5a8080
|
|
26
|
+
cursor-text = #f8f8f8
|
|
27
|
+
selection-background = #d0d0e0
|
|
28
|
+
selection-foreground = #3b3b3b
|
|
29
|
+
split-divider-color = #b0b0b0
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Git reads this file and then ~/.gitconfig, which stays free for what tools
|
|
2
|
+
# write there (gh's credential helper, git-lfs filters) and for the host's own
|
|
3
|
+
# identity (user.name, user.email), which the baseline does not set.
|
|
4
|
+
[init]
|
|
5
|
+
defaultBranch = main
|
|
6
|
+
[push]
|
|
7
|
+
autoSetupRemote = true
|
|
8
|
+
[core]
|
|
9
|
+
pager = delta
|
|
10
|
+
[interactive]
|
|
11
|
+
diffFilter = delta --color-only
|
|
12
|
+
[delta]
|
|
13
|
+
navigate = true
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Fleet Starship prompt: omp's status-line layout, with the host where omp shows
|
|
2
|
+
# the agent. One line holds the left group [host directory git], a
|
|
3
|
+
# rule, and the right group [last command's duration clock]; the next line
|
|
4
|
+
# is the character. omp's agent emoji and name map to the host emoji and name,
|
|
5
|
+
# its turn timer to the last command's duration, its git counts to the same `*`
|
|
6
|
+
# unstaged, `+` staged and `?` untracked.
|
|
7
|
+
#
|
|
8
|
+
# Every color is a terminal color name, never an exact one (hex or a 256-color
|
|
9
|
+
# number): the active Ghostty theme gives each name its shade, so the prompt
|
|
10
|
+
# follows LexLight and LexDark as the system appearance switches, on remote
|
|
11
|
+
# hosts too. An exact or unknown color breaks that: starship names ANSI
|
|
12
|
+
# magenta `purple`, and an unknown name draws uncolored. Roles: host
|
|
13
|
+
# purple, separators and rule bright-black, directory bright-blue, branch and
|
|
14
|
+
# staged green, unstaged yellow, untracked cyan, duration and clock white,
|
|
15
|
+
# read-only and a failed command red.
|
|
16
|
+
#
|
|
17
|
+
# Glyphs are Nerd Font PUA + emoji; naive text edits strip them, so edit them by
|
|
18
|
+
# codepoint.
|
|
19
|
+
|
|
20
|
+
"$schema" = 'https://starship.rs/config-schema.json'
|
|
21
|
+
add_newline = false
|
|
22
|
+
|
|
23
|
+
format = """
|
|
24
|
+
${custom.device}\
|
|
25
|
+
[ ](bright-black)\
|
|
26
|
+
$directory\
|
|
27
|
+
$git_branch\
|
|
28
|
+
$git_status \
|
|
29
|
+
$fill \
|
|
30
|
+
$cmd_duration\
|
|
31
|
+
$time\
|
|
32
|
+
\n$character"""
|
|
33
|
+
|
|
34
|
+
# Parent directories dim and the repository root strong, as omp draws a path.
|
|
35
|
+
[directory]
|
|
36
|
+
style = "bright-blue"
|
|
37
|
+
before_repo_root_style = "dimmed bright-blue"
|
|
38
|
+
repo_root_style = "bold bright-blue"
|
|
39
|
+
read_only_style = "red"
|
|
40
|
+
format = "[ $path]($style)[$read_only]($read_only_style)"
|
|
41
|
+
repo_root_format = "[ ]($style)[$before_root_path]($before_repo_root_style)[$repo_root]($repo_root_style)[$path]($style)[$read_only]($read_only_style)"
|
|
42
|
+
truncation_length = 3
|
|
43
|
+
truncation_symbol = "…/"
|
|
44
|
+
|
|
45
|
+
# The separator belongs to the git segment, so it shows only inside a repository.
|
|
46
|
+
[git_branch]
|
|
47
|
+
symbol = ""
|
|
48
|
+
format = "[ ](bright-black)[$symbol $branch](green)"
|
|
49
|
+
|
|
50
|
+
[git_status]
|
|
51
|
+
format = "($modified$staged$untracked)"
|
|
52
|
+
modified = "[ *${count}](yellow)"
|
|
53
|
+
staged = "[ +${count}](green)"
|
|
54
|
+
untracked = "[ ?${count}](cyan)"
|
|
55
|
+
|
|
56
|
+
[cmd_duration]
|
|
57
|
+
min_time = 2000
|
|
58
|
+
format = "[$duration](white)[ ](bright-black)"
|
|
59
|
+
|
|
60
|
+
[time]
|
|
61
|
+
disabled = false
|
|
62
|
+
time_format = "%R"
|
|
63
|
+
format = "[ $time](white)"
|
|
64
|
+
|
|
65
|
+
[fill]
|
|
66
|
+
symbol = "─"
|
|
67
|
+
style = "bright-black"
|
|
68
|
+
|
|
69
|
+
[custom.device]
|
|
70
|
+
when = true
|
|
71
|
+
command = '''
|
|
72
|
+
# The icon is the host's own, from host.toml (`fleet config set icon`). fleet
|
|
73
|
+
# accepts only an emoji that needs no VS16 (U+FE0F): a VS16 emoji is
|
|
74
|
+
# EAW=Neutral (1 cell) by the Unicode table but Ghostty draws it 2 cells wide,
|
|
75
|
+
# so starship's $fill math is off by one and the status line overruns.
|
|
76
|
+
printf "%s %s" "@ICON@" "$HOST"
|
|
77
|
+
'''
|
|
78
|
+
format = "[$output](purple)"
|
|
79
|
+
|
|
80
|
+
[character]
|
|
81
|
+
success_symbol = "[❯](bold green)"
|
|
82
|
+
error_symbol = "[❯](bold red)"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# leclabs interactive shell. Load order matters: completion, then fzf, then
|
|
2
|
+
# fzf-tab (so it owns TAB), then the prompt and tool hooks, then atuin (so it
|
|
3
|
+
# owns Ctrl-R and Up), and syntax highlighting last because it wraps every
|
|
4
|
+
# widget defined before it.
|
|
5
|
+
|
|
6
|
+
autoload -Uz compinit && compinit
|
|
7
|
+
|
|
8
|
+
source <(fzf --zsh)
|
|
9
|
+
|
|
10
|
+
zsh_plugins="$HOME/.local/share/zsh/plugins"
|
|
11
|
+
source "$zsh_plugins/fzf-tab/fzf-tab.plugin.zsh"
|
|
12
|
+
source "$zsh_plugins/zsh-autosuggestions/zsh-autosuggestions.zsh"
|
|
13
|
+
|
|
14
|
+
# starship's custom.device module runs in a child shell and reads $HOST.
|
|
15
|
+
export HOST
|
|
16
|
+
eval "$(starship init zsh)"
|
|
17
|
+
eval "$(zoxide init zsh)"
|
|
18
|
+
|
|
19
|
+
eval "$(atuin init zsh)"
|
|
20
|
+
# Newer atuin releases bind `?` at an empty prompt to a hosted service; keep it
|
|
21
|
+
# a plain character on every host whatever atuin version the OS ships.
|
|
22
|
+
bindkey '?' self-insert
|
|
23
|
+
|
|
24
|
+
HISTFILE="$HOME/.zsh_history"
|
|
25
|
+
HISTSIZE=100000
|
|
26
|
+
SAVEHIST=100000
|
|
27
|
+
setopt SHARE_HISTORY HIST_IGNORE_DUPS HIST_REDUCE_BLANKS EXTENDED_HISTORY
|
|
28
|
+
|
|
29
|
+
alias ll='eza --group-directories-first --icons=auto -lah'
|
|
30
|
+
alias la='eza --group-directories-first --icons=auto -a'
|
|
31
|
+
alias lt='eza --group-directories-first --icons=auto --tree'
|
|
32
|
+
|
|
33
|
+
export EDITOR=nvim VISUAL=nvim
|
|
34
|
+
|
|
35
|
+
source "$zsh_plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh"
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# The base layer: what every host shares, so the toolkit feels the same on each
|
|
2
|
+
# one. The linux and macos layers add what differs by OS; the opt-in layers add
|
|
3
|
+
# what a host chose (nvidia, docker). fleet renders this file as the conf.d
|
|
4
|
+
# fragment fleet-base, whose relative paths resolve inside that folder.
|
|
5
|
+
#
|
|
6
|
+
# Channel rule: an unprefixed package installs through the host's package
|
|
7
|
+
# manager (brew on macOS, apt on Ubuntu) at whatever version it ships. [tools]
|
|
8
|
+
# holds only what a package manager cannot serve the same way everywhere.
|
|
9
|
+
|
|
10
|
+
[bootstrap.packages]
|
|
11
|
+
bash = "latest"
|
|
12
|
+
bat = "latest"
|
|
13
|
+
btop = "latest"
|
|
14
|
+
dust = { names = { apt = "du-dust" } }
|
|
15
|
+
eza = "latest"
|
|
16
|
+
fd = { names = { apt = "fd-find" } }
|
|
17
|
+
ffmpeg = "latest"
|
|
18
|
+
fzf = "latest"
|
|
19
|
+
gh = "latest"
|
|
20
|
+
git = "latest"
|
|
21
|
+
git-delta = "latest"
|
|
22
|
+
git-lfs = "latest"
|
|
23
|
+
jq = "latest"
|
|
24
|
+
lazygit = "latest"
|
|
25
|
+
neovim = "latest"
|
|
26
|
+
podman = "latest"
|
|
27
|
+
podman-compose = "latest"
|
|
28
|
+
ripgrep = "latest"
|
|
29
|
+
shellcheck = "latest"
|
|
30
|
+
shfmt = "latest"
|
|
31
|
+
starship = "latest"
|
|
32
|
+
tree = "latest"
|
|
33
|
+
zoxide = "latest"
|
|
34
|
+
|
|
35
|
+
# Language runtimes are system defaults; a project overrides them with its own
|
|
36
|
+
# mise.toml or with the files its ecosystem reads (see [settings] below).
|
|
37
|
+
[tools]
|
|
38
|
+
bun = "latest"
|
|
39
|
+
go = "latest"
|
|
40
|
+
node = "lts"
|
|
41
|
+
pnpm = "latest"
|
|
42
|
+
python = "latest"
|
|
43
|
+
rust = "stable"
|
|
44
|
+
uv = "latest"
|
|
45
|
+
# The registry's yq is mikefarah's; apt's yq is a different program.
|
|
46
|
+
yq = "latest"
|
|
47
|
+
# atuin's history database only migrates forward, so every host runs the same,
|
|
48
|
+
# current atuin; Ubuntu's archive build is too old to open what a newer one wrote.
|
|
49
|
+
atuin = "latest"
|
|
50
|
+
tmux = "latest"
|
|
51
|
+
|
|
52
|
+
# Read each ecosystem's own version file, so a project pinned with
|
|
53
|
+
# rust-toolchain.toml, .nvmrc, .python-version, go.mod or package.json overrides
|
|
54
|
+
# the defaults above. mise sets RUSTUP_TOOLCHAIN for its rust, which outranks
|
|
55
|
+
# rust-toolchain.toml unless mise reads that file itself.
|
|
56
|
+
[settings]
|
|
57
|
+
idiomatic_version_file_enable_tools = ["bun", "go", "node", "python", "rust"]
|
|
58
|
+
|
|
59
|
+
[bootstrap.repos]
|
|
60
|
+
"~/.local/share/zsh/plugins/fzf-tab" = { url = "https://github.com/Aloxaf/fzf-tab.git" }
|
|
61
|
+
"~/.local/share/zsh/plugins/zsh-autosuggestions" = { url = "https://github.com/zsh-users/zsh-autosuggestions.git" }
|
|
62
|
+
"~/.local/share/zsh/plugins/zsh-syntax-highlighting" = { url = "https://github.com/zsh-users/zsh-syntax-highlighting.git" }
|
|
63
|
+
|
|
64
|
+
# A bare name resolves to each OS's own zsh (/bin/zsh on macOS, /usr/bin/zsh on
|
|
65
|
+
# Ubuntu), so a host already on zsh is left as it is.
|
|
66
|
+
[bootstrap.user]
|
|
67
|
+
login_shell = "zsh"
|
|
68
|
+
|
|
69
|
+
# Login shells get shims, interactive shells full activation, and ~/.zshenv
|
|
70
|
+
# shims too, so `ssh <host> <command>` resolves the same tools.
|
|
71
|
+
[bootstrap.mise_shell_activate]
|
|
72
|
+
zsh = true
|
|
73
|
+
zshenv = "shims"
|
|
74
|
+
|
|
75
|
+
[dotfiles]
|
|
76
|
+
"~/.zshenv/path" = { block = '''
|
|
77
|
+
typeset -U path
|
|
78
|
+
path=("$HOME/.local/bin" $path)''' }
|
|
79
|
+
"~/.zshrc/leclabs" = { source = "dotfiles/zshrc.zsh", template = "tera" }
|
|
80
|
+
"~/.config/starship.toml" = { source = "dotfiles/starship.toml", mode = "symlink" }
|
|
81
|
+
"~/.config/ghostty/config.ghostty" = { source = "dotfiles/ghostty/config.ghostty", mode = "symlink" }
|
|
82
|
+
"~/.config/ghostty/themes/LexLight" = { source = "dotfiles/ghostty/themes/LexLight", mode = "symlink" }
|
|
83
|
+
"~/.config/ghostty/themes/LexDark" = { source = "dotfiles/ghostty/themes/LexDark", mode = "symlink" }
|
|
84
|
+
"~/.config/atuin/config.toml" = { source = "dotfiles/atuin/config.toml", mode = "symlink" }
|
|
85
|
+
"~/.config/git/config" = { source = "dotfiles/git/config", mode = "symlink" }
|
|
86
|
+
|
|
87
|
+
# Runs last in every user run; each step is a no-op once done or when the
|
|
88
|
+
# command it needs is not there yet (the machine run installs git-lfs). fleet
|
|
89
|
+
# puts ~/.local/bin on PATH for the run.
|
|
90
|
+
[tasks.bootstrap]
|
|
91
|
+
run = [
|
|
92
|
+
"command -v claude >/dev/null || curl -fsSL https://claude.ai/install.sh | bash",
|
|
93
|
+
"command -v omp >/dev/null || curl -fsSL https://omp.sh/install | sh",
|
|
94
|
+
"[ -d ~/.config/nvim ] || { git clone --quiet --depth 1 https://github.com/LazyVim/starter ~/.config/nvim && rm -rf ~/.config/nvim/.git; }",
|
|
95
|
+
"if command -v git-lfs >/dev/null 2>&1; then git lfs install --skip-repo >/dev/null; fi",
|
|
96
|
+
]
|