@leclabs/fleet 0.0.0-stage → 0.1.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
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Docker layer, opt-in (`layers = ["docker"]` in host.toml), Linux only: Docker
|
|
2
|
+
# Engine, the CLI, containerd and the buildx and Compose plugins from Docker's
|
|
3
|
+
# apt repository, and the `local` log driver. host.toml's user joins the `docker`
|
|
4
|
+
# group through the generated fleet-host fragment. Everything here is the machine
|
|
5
|
+
# layer's.
|
|
6
|
+
|
|
7
|
+
[bootstrap.apt.sources.docker]
|
|
8
|
+
uris = "https://download.docker.com/linux/ubuntu"
|
|
9
|
+
components = "stable"
|
|
10
|
+
key = "https://download.docker.com/linux/ubuntu/gpg"
|
|
11
|
+
fingerprint = "9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88"
|
|
12
|
+
|
|
13
|
+
[bootstrap.packages]
|
|
14
|
+
"apt:docker-ce" = "latest"
|
|
15
|
+
"apt:docker-ce-cli" = "latest"
|
|
16
|
+
"apt:containerd.io" = "latest"
|
|
17
|
+
"apt:docker-buildx-plugin" = "latest"
|
|
18
|
+
"apt:docker-compose-plugin" = "latest"
|
|
19
|
+
|
|
20
|
+
# The package creates this group too; declaring it lets the accounts step add the
|
|
21
|
+
# user to it before the package is installed.
|
|
22
|
+
[bootstrap.groups.docker]
|
|
23
|
+
system = true
|
|
24
|
+
|
|
25
|
+
# The daemon reads daemon.json at start, so the file lands before the package
|
|
26
|
+
# starts it, and a running daemon restarts when the file changes.
|
|
27
|
+
[bootstrap.directories."/etc/docker"]
|
|
28
|
+
owner = "root"
|
|
29
|
+
group = "root"
|
|
30
|
+
mode = "0755"
|
|
31
|
+
phase = "pre-packages"
|
|
32
|
+
|
|
33
|
+
[bootstrap.files."/etc/docker/daemon.json"]
|
|
34
|
+
owner = "root"
|
|
35
|
+
group = "root"
|
|
36
|
+
mode = "0644"
|
|
37
|
+
phase = "pre-packages"
|
|
38
|
+
notify = ["docker"]
|
|
39
|
+
content = '''
|
|
40
|
+
{
|
|
41
|
+
"log-driver": "local"
|
|
42
|
+
}
|
|
43
|
+
'''
|
|
44
|
+
|
|
45
|
+
[bootstrap.services.docker]
|
|
46
|
+
state = "running"
|
|
47
|
+
enabled = true
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Linux layer (Ubuntu): the apps and system packages that apt, snap and flatpak
|
|
2
|
+
# provide here, the vendor repositories they come from, and the daily timer that
|
|
3
|
+
# keeps the host current. apt and snap packages are the machine layer's;
|
|
4
|
+
# flatpak apps, the timer and the dotfiles below are the user layer's.
|
|
5
|
+
|
|
6
|
+
[bootstrap.apt.sources.github-cli]
|
|
7
|
+
uris = "https://cli.github.com/packages"
|
|
8
|
+
suites = "stable"
|
|
9
|
+
key = "https://cli.github.com/packages/githubcli-archive-keyring.gpg"
|
|
10
|
+
fingerprint = "7F38 BBB5 9D06 4DBC B3D8 4D72 5612 B364 6231 3325"
|
|
11
|
+
|
|
12
|
+
[bootstrap.apt.sources.vscode]
|
|
13
|
+
uris = "https://packages.microsoft.com/repos/code"
|
|
14
|
+
suites = "stable"
|
|
15
|
+
key = "https://packages.microsoft.com/keys/microsoft.asc"
|
|
16
|
+
fingerprint = "BC52 8686 B50D 79E3 39D3 721C EB3E 94AD BE12 29CF"
|
|
17
|
+
|
|
18
|
+
# mise sets the suite to the host's release codename. Tailscale signs every
|
|
19
|
+
# release with the one key below; the URL only says where to fetch it.
|
|
20
|
+
[bootstrap.apt.sources.tailscale]
|
|
21
|
+
uris = "https://pkgs.tailscale.com/stable/ubuntu"
|
|
22
|
+
key = "https://pkgs.tailscale.com/stable/ubuntu/resolute.noarmor.gpg"
|
|
23
|
+
fingerprint = "2596 A99E AAB3 3821 893C 0A79 458C A832 957F 5868"
|
|
24
|
+
|
|
25
|
+
[bootstrap.packages]
|
|
26
|
+
"apt:build-essential" = "latest"
|
|
27
|
+
"apt:code" = "latest"
|
|
28
|
+
"apt:flatpak" = "latest"
|
|
29
|
+
"apt:fontconfig" = "latest"
|
|
30
|
+
# JetBrains Mono for every app; Ghostty draws the Nerd Font symbols itself.
|
|
31
|
+
"apt:fonts-jetbrains-mono" = "latest"
|
|
32
|
+
"apt:fonts-noto-color-emoji" = "latest"
|
|
33
|
+
"apt:ghostty" = "latest"
|
|
34
|
+
# The node that mise installs links libatomic, which minimal images lack.
|
|
35
|
+
"apt:libatomic1" = "latest"
|
|
36
|
+
"apt:pkg-config" = "latest"
|
|
37
|
+
"apt:tailscale" = "latest"
|
|
38
|
+
"apt:zsh" = "latest"
|
|
39
|
+
"flatpak-user:io.podman_desktop.PodmanDesktop" = "latest"
|
|
40
|
+
# Obsidian and Slack publish their Linux apps as snaps, which keep themselves up
|
|
41
|
+
# to date.
|
|
42
|
+
"snap:obsidian" = { classic = true }
|
|
43
|
+
"snap:slack" = "latest"
|
|
44
|
+
|
|
45
|
+
# mise does not configure flatpak remotes. Once flatpak is installed (the machine
|
|
46
|
+
# run installs it), the user's Flathub remote is added and the flatpak apps
|
|
47
|
+
# install for the user, which needs no root.
|
|
48
|
+
[bootstrap.hooks.post-tools]
|
|
49
|
+
description = "Add Flathub for the user and install the flatpak apps"
|
|
50
|
+
run = '''
|
|
51
|
+
command -v flatpak >/dev/null || exit 0
|
|
52
|
+
flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
|
53
|
+
mise bootstrap packages apply --manager flatpak-user --yes
|
|
54
|
+
'''
|
|
55
|
+
|
|
56
|
+
# Ubuntu ships these two commands under other names. They link once the machine
|
|
57
|
+
# run has installed bat and fd, and a user run before that leaves them for the
|
|
58
|
+
# next one. A real file at either name is the user's and stays.
|
|
59
|
+
[bootstrap.hooks.post-dotfiles]
|
|
60
|
+
description = "Link bat and fd under their upstream names"
|
|
61
|
+
run = '''
|
|
62
|
+
mkdir -p "$HOME/.local/bin"
|
|
63
|
+
link() {
|
|
64
|
+
[ -x "$1" ] || return 0
|
|
65
|
+
if [ -e "$2" ] && [ ! -L "$2" ]; then return 0; fi
|
|
66
|
+
ln -sfn "$1" "$2"
|
|
67
|
+
}
|
|
68
|
+
link /usr/bin/batcat "$HOME/.local/bin/bat"
|
|
69
|
+
link /usr/bin/fdfind "$HOME/.local/bin/fd"
|
|
70
|
+
'''
|
|
71
|
+
|
|
72
|
+
# The self-update timer: daily, `fleet update && fleet apply --upgrade` as the
|
|
73
|
+
# user, so "current" means upgraded. A unit
|
|
74
|
+
# gets neither the shell's PATH nor mise's activation, so PATH names the shims
|
|
75
|
+
# that resolve fleet.
|
|
76
|
+
[bootstrap.linux.systemd.units.fleet-update]
|
|
77
|
+
description = "Update fleet, then apply and upgrade the user baseline"
|
|
78
|
+
type = "oneshot"
|
|
79
|
+
exec_start = "/bin/sh -c 'fleet update && fleet apply --upgrade'"
|
|
80
|
+
environment = { PATH = "%h/.local/share/mise/shims:%h/.local/bin:/usr/local/bin:/usr/bin:/bin" }
|
|
81
|
+
start = false
|
|
82
|
+
wanted_by = []
|
|
83
|
+
|
|
84
|
+
[bootstrap.linux.systemd.units.fleet-update-daily]
|
|
85
|
+
description = "Update fleet and apply the user baseline daily"
|
|
86
|
+
on_calendar = "daily"
|
|
87
|
+
persistent = true
|
|
88
|
+
randomized_delay_sec = "1h"
|
|
89
|
+
unit = "fleet-update"
|
|
90
|
+
|
|
91
|
+
[dotfiles]
|
|
92
|
+
# pnpm's default home on Linux: `pnpm add -g` installs there, last on PATH.
|
|
93
|
+
"~/.zshenv/pnpm" = { block = '''
|
|
94
|
+
export PNPM_HOME="$HOME/.local/share/pnpm"
|
|
95
|
+
path+=("$PNPM_HOME/bin")''' }
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Intel Mac layer, which fleet adds after the macos layer on macOS x86_64 alone.
|
|
2
|
+
# mise's brew manager does not run on an Intel Mac and skips every formula; each
|
|
3
|
+
# comes instead from its vendor's release build through mise's registry
|
|
4
|
+
# (LEARNINGS.md, "An Intel Mac takes its formulae from their vendors' release
|
|
5
|
+
# builds"). Each entry was installed on an Intel Mac with mise 2026.11.10. Casks
|
|
6
|
+
# still install through brew-cask.
|
|
7
|
+
#
|
|
8
|
+
# Left to macOS's own program: bash, git (the Command Line Tools'), and the GNU
|
|
9
|
+
# g-names (gstat, gsed, gdate, gawk, ggrep), which have no Intel build.
|
|
10
|
+
# Left out: btop and podman (no x86_64 macOS build), podman-compose (no engine
|
|
11
|
+
# to drive; Podman Desktop sets up its own), ffmpeg (conda only) and tree.
|
|
12
|
+
[tools]
|
|
13
|
+
bat = "latest"
|
|
14
|
+
dust = "latest"
|
|
15
|
+
eza = "latest"
|
|
16
|
+
fd = "latest"
|
|
17
|
+
fzf = "latest"
|
|
18
|
+
gh = "latest"
|
|
19
|
+
git-lfs = "latest"
|
|
20
|
+
jq = "latest"
|
|
21
|
+
lazygit = "latest"
|
|
22
|
+
neovim = "latest"
|
|
23
|
+
ripgrep = "latest"
|
|
24
|
+
shellcheck = "latest"
|
|
25
|
+
shfmt = "latest"
|
|
26
|
+
starship = "latest"
|
|
27
|
+
zoxide = "latest"
|
|
28
|
+
# delta publishes no x86_64 macOS build; it is built from its crates.io source
|
|
29
|
+
# with the rust config.toml declares, linked by the Command Line Tools. git's
|
|
30
|
+
# pager is delta on every host.
|
|
31
|
+
"cargo:git-delta" = "latest"
|
|
32
|
+
|
|
33
|
+
# atuin likewise: config.toml declares it, and on an Intel Mac it builds from
|
|
34
|
+
# crates.io. Every shell starts it, so it cannot be left out.
|
|
35
|
+
[tool_alias]
|
|
36
|
+
atuin = "cargo:atuin"
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# macOS layer: apps through mise's brew-cask manager, and the GNU userland under
|
|
2
|
+
# its g-prefixed names (gstat, gsed, gdate, gawk, ggrep), beside macOS's own
|
|
3
|
+
# commands. mise installs every formula and cask into /opt/homebrew itself;
|
|
4
|
+
# Homebrew is not installed. Packages, the Command Line Tools hook and the
|
|
5
|
+
# system files are the machine layer's; the desktop settings, the Dock, the
|
|
6
|
+
# dotfiles and the self-update agent are the user layer's.
|
|
7
|
+
|
|
8
|
+
[bootstrap.packages]
|
|
9
|
+
"brew:coreutils" = "latest"
|
|
10
|
+
"brew:gawk" = "latest"
|
|
11
|
+
"brew:gnu-sed" = "latest"
|
|
12
|
+
"brew:grep" = "latest"
|
|
13
|
+
# JetBrains Mono for every app; Ghostty draws the Nerd Font symbols itself.
|
|
14
|
+
"brew-cask:font-jetbrains-mono" = "latest"
|
|
15
|
+
"brew-cask:chatgpt" = "latest"
|
|
16
|
+
"brew-cask:ghostty" = "latest"
|
|
17
|
+
"brew-cask:google-chrome" = "latest"
|
|
18
|
+
"brew-cask:obsidian" = "latest"
|
|
19
|
+
"brew-cask:podman-desktop" = "latest"
|
|
20
|
+
"brew-cask:slack" = "latest"
|
|
21
|
+
"brew-cask:stats" = "latest"
|
|
22
|
+
"brew-cask:tailscale-app" = "latest"
|
|
23
|
+
"brew-cask:visual-studio-code" = "latest"
|
|
24
|
+
"brew-cask:whatsapp" = "latest"
|
|
25
|
+
|
|
26
|
+
# An app already in /Applications is adopted in place rather than replaced, so a
|
|
27
|
+
# Mac moving to mise keeps its apps, their open windows and their privacy grants.
|
|
28
|
+
[bootstrap.brew]
|
|
29
|
+
adopt = true
|
|
30
|
+
|
|
31
|
+
# The Command Line Tools supply the compilers that build-essential supplies on
|
|
32
|
+
# Ubuntu. softwareupdate installs them without the GUI prompt.
|
|
33
|
+
[bootstrap.hooks.pre-packages]
|
|
34
|
+
description = "Install the Command Line Tools when missing"
|
|
35
|
+
run = '''
|
|
36
|
+
if ! xcode-select -p >/dev/null 2>&1; then
|
|
37
|
+
marker=/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
|
|
38
|
+
touch "$marker"
|
|
39
|
+
label="$(softwareupdate --list 2>/dev/null | sed -n 's/^\* Label: \(Command Line Tools.*\)$/\1/p' | tail -1)"
|
|
40
|
+
sudo softwareupdate --install "$label" --agree-to-license
|
|
41
|
+
rm -f "$marker"
|
|
42
|
+
fi
|
|
43
|
+
'''
|
|
44
|
+
|
|
45
|
+
# The command-line launcher the Tailscale app's own CLI integration installs,
|
|
46
|
+
# the same for the app's App Store and standalone builds.
|
|
47
|
+
[bootstrap.directories."/usr/local/bin"]
|
|
48
|
+
owner = "root"
|
|
49
|
+
group = "wheel"
|
|
50
|
+
mode = "0755"
|
|
51
|
+
|
|
52
|
+
[bootstrap.files."/usr/local/bin/tailscale"]
|
|
53
|
+
owner = "root"
|
|
54
|
+
group = "wheel"
|
|
55
|
+
mode = "0755"
|
|
56
|
+
content = '''
|
|
57
|
+
#!/bin/sh
|
|
58
|
+
/Applications/Tailscale.app/Contents/MacOS/Tailscale "$@"
|
|
59
|
+
'''
|
|
60
|
+
|
|
61
|
+
# The self-update agent: daily at 04:00, `fleet update && fleet apply --upgrade`
|
|
62
|
+
# as the user. A LaunchAgent gets launchd's environment, so PATH names the shims that
|
|
63
|
+
# resolve fleet.
|
|
64
|
+
[bootstrap.macos.launchd.agents.fleet-update]
|
|
65
|
+
program = "/bin/sh"
|
|
66
|
+
args = ["-c", "fleet update && fleet apply --upgrade"]
|
|
67
|
+
start_calendar_interval = [{ hour = 4, minute = 0 }]
|
|
68
|
+
process_type = "Background"
|
|
69
|
+
environment = { PATH = "{{ env.HOME }}/.local/share/mise/shims:{{ env.HOME }}/.local/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin" }
|
|
70
|
+
stdout_path = "~/Library/Logs/fleet-update.log"
|
|
71
|
+
stderr_path = "~/Library/Logs/fleet-update.log"
|
|
72
|
+
|
|
73
|
+
# The desktop every Mac shares; only what differs from
|
|
74
|
+
# macOS's defaults is declared.
|
|
75
|
+
[bootstrap.settings.macos.dock]
|
|
76
|
+
apps = [
|
|
77
|
+
"/System/Applications/Apps.app",
|
|
78
|
+
"/Applications/Google Chrome.app",
|
|
79
|
+
"/Applications/Ghostty.app",
|
|
80
|
+
"/Applications/Visual Studio Code.app",
|
|
81
|
+
"/Applications/Tailscale.app",
|
|
82
|
+
"/System/Applications/Passwords.app",
|
|
83
|
+
"/System/Applications/System Settings.app",
|
|
84
|
+
"/Applications/Slack.app",
|
|
85
|
+
"/Applications/WhatsApp.app",
|
|
86
|
+
"/System/Applications/Messages.app",
|
|
87
|
+
"/Applications/ChatGPT.app",
|
|
88
|
+
"/System/Applications/Reminders.app",
|
|
89
|
+
"/System/Applications/Notes.app",
|
|
90
|
+
"/System/Applications/iPhone Mirroring.app",
|
|
91
|
+
]
|
|
92
|
+
|
|
93
|
+
# Accessibility → Display → Pointer: a larger pointer, green with a magenta
|
|
94
|
+
# outline.
|
|
95
|
+
[bootstrap.settings.macos.defaults."com.apple.universalaccess"]
|
|
96
|
+
mouseDriverCursorSize = 2.018164752650177
|
|
97
|
+
cursorIsCustomized = true
|
|
98
|
+
cursorFill = { red = 0.0, green = 0.9834460616111755, blue = 0.0, alpha = 1.0 }
|
|
99
|
+
cursorOutline = { red = 1.0, green = 0.0, blue = 0.976635754108429, alpha = 1.0 }
|
|
100
|
+
|
|
101
|
+
# Keyboard Shortcuts → Input Sources: ⌃Space selects the previous input source
|
|
102
|
+
# and ⌃⌥Space the next one, on every Mac.
|
|
103
|
+
[[bootstrap.settings.macos.defaults_entries]]
|
|
104
|
+
domain = "com.apple.symbolichotkeys"
|
|
105
|
+
key = "AppleSymbolicHotKeys"
|
|
106
|
+
path = ["60"]
|
|
107
|
+
value = { enabled = true, value = { type = "standard", parameters = [32, 49, 262144] } }
|
|
108
|
+
|
|
109
|
+
[[bootstrap.settings.macos.defaults_entries]]
|
|
110
|
+
domain = "com.apple.symbolichotkeys"
|
|
111
|
+
key = "AppleSymbolicHotKeys"
|
|
112
|
+
path = ["61"]
|
|
113
|
+
value = { enabled = true, value = { type = "standard", parameters = [32, 49, 786432] } }
|
|
114
|
+
|
|
115
|
+
# Keyboard Shortcuts → Windows: the Arrange shortcuts, Quarters among them
|
|
116
|
+
# (entries 244 to 247: fn⇧⌃⌥←, fn⇧⌃⌥→, fn⌃⌥←, fn⌃⌥→). Each entry sets one
|
|
117
|
+
# shortcut and leaves the rest.
|
|
118
|
+
[[bootstrap.settings.macos.defaults_entries]]
|
|
119
|
+
domain = "com.apple.symbolichotkeys"
|
|
120
|
+
key = "AppleSymbolicHotKeys"
|
|
121
|
+
path = ["244"]
|
|
122
|
+
value = { enabled = true, value = { type = "standard", parameters = [65535, 123, 9306112] } }
|
|
123
|
+
|
|
124
|
+
[[bootstrap.settings.macos.defaults_entries]]
|
|
125
|
+
domain = "com.apple.symbolichotkeys"
|
|
126
|
+
key = "AppleSymbolicHotKeys"
|
|
127
|
+
path = ["245"]
|
|
128
|
+
value = { enabled = true, value = { type = "standard", parameters = [65535, 124, 9306112] } }
|
|
129
|
+
|
|
130
|
+
[[bootstrap.settings.macos.defaults_entries]]
|
|
131
|
+
domain = "com.apple.symbolichotkeys"
|
|
132
|
+
key = "AppleSymbolicHotKeys"
|
|
133
|
+
path = ["246"]
|
|
134
|
+
value = { enabled = true, value = { type = "standard", parameters = [65535, 123, 9175040] } }
|
|
135
|
+
|
|
136
|
+
[[bootstrap.settings.macos.defaults_entries]]
|
|
137
|
+
domain = "com.apple.symbolichotkeys"
|
|
138
|
+
key = "AppleSymbolicHotKeys"
|
|
139
|
+
path = ["247"]
|
|
140
|
+
value = { enabled = true, value = { type = "standard", parameters = [65535, 124, 9175040] } }
|
|
141
|
+
|
|
142
|
+
# mise writes preferences but restarts nothing. The Dock relaunches to show its
|
|
143
|
+
# apps, and activateSettings loads the shortcuts into the running session.
|
|
144
|
+
[bootstrap.hooks.post-defaults]
|
|
145
|
+
description = "Show the Dock and shortcuts in the running session"
|
|
146
|
+
run = '''
|
|
147
|
+
killall Dock 2>/dev/null || true
|
|
148
|
+
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u 2>/dev/null || true
|
|
149
|
+
'''
|
|
150
|
+
|
|
151
|
+
[dotfiles]
|
|
152
|
+
# mise links formulae into /opt/homebrew/bin but leaves PATH to the shell. Ahead
|
|
153
|
+
# of /usr/bin it lets newer versions of macOS's own programs win (git, bash, jq);
|
|
154
|
+
# GNU's differing tools stay under their g-names, so `stat` is still macOS's.
|
|
155
|
+
"~/.zshenv/homebrew" = { block = 'path=(/opt/homebrew/bin /opt/homebrew/sbin $path)' }
|
|
156
|
+
# pnpm's default home: `pnpm add -g` installs there. Its bin directory comes
|
|
157
|
+
# last on PATH, so a package you add never replaces a command.
|
|
158
|
+
"~/.zshenv/pnpm" = { block = '''
|
|
159
|
+
export PNPM_HOME="$HOME/Library/pnpm"
|
|
160
|
+
path+=("$PNPM_HOME/bin")''' }
|
|
161
|
+
# /etc/zprofile runs path_helper, which moves the system directories back in
|
|
162
|
+
# front; re-reading ~/.zshenv restores the order for login shells.
|
|
163
|
+
"~/.zprofile/path" = { block = 'source "$HOME/.zshenv"' }
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# NVIDIA layer, opt-in (`layers = ["nvidia"]` in host.toml), Ubuntu only: the
|
|
2
|
+
# driver Ubuntu recommends for the GPU, with the kernel modules Ubuntu prebuilds
|
|
3
|
+
# and signs for the host's kernel, and NVIDIA's container toolkit. The toolkit's
|
|
4
|
+
# nvidia-cdi-refresh service keeps the CDI spec in /var/run/cdi current, so
|
|
5
|
+
# `podman run --device nvidia.com/gpu=all` works. Everything here is the machine
|
|
6
|
+
# layer's, so the hooks run as root.
|
|
7
|
+
|
|
8
|
+
# NVIDIA's repository for the container toolkit alone; it carries no driver.
|
|
9
|
+
[bootstrap.apt.sources.nvidia-container-toolkit]
|
|
10
|
+
# NVIDIA's own source line has deb/$(ARCH); mise 2026.12.0 fails to write a
|
|
11
|
+
# source holding $(ARCH) (`install: No such file or directory`), so the
|
|
12
|
+
# architecture is written out: the layer serves amd64 GPU hosts.
|
|
13
|
+
uris = "https://nvidia.github.io/libnvidia-container/stable/deb/amd64"
|
|
14
|
+
suites = "/"
|
|
15
|
+
key = "https://nvidia.github.io/libnvidia-container/gpgkey"
|
|
16
|
+
fingerprint = "C95B 321B 61E8 8C18 09C4 F759 DDCA E044 F796 ECB0"
|
|
17
|
+
|
|
18
|
+
[bootstrap.packages]
|
|
19
|
+
"apt:ubuntu-drivers-common" = "latest"
|
|
20
|
+
"apt:nvidia-container-toolkit" = "latest"
|
|
21
|
+
|
|
22
|
+
# The boot menu shows for 5 seconds instead of staying hidden, so a host whose
|
|
23
|
+
# driver fails can be started in recovery mode without timing a keypress.
|
|
24
|
+
[bootstrap.files."/etc/default/grub.d/90-fleet.cfg"]
|
|
25
|
+
owner = "root"
|
|
26
|
+
group = "root"
|
|
27
|
+
mode = "0644"
|
|
28
|
+
content = '''
|
|
29
|
+
GRUB_TIMEOUT_STYLE=menu
|
|
30
|
+
GRUB_TIMEOUT=5
|
|
31
|
+
'''
|
|
32
|
+
|
|
33
|
+
# Ubuntu chooses the driver, as its installer and Additional Drivers do:
|
|
34
|
+
# `ubuntu-drivers install` installs the NVIDIA branch it recommends for the GPU
|
|
35
|
+
# and that branch's prebuilt modules for the host's kernel. The fleet names no
|
|
36
|
+
# branch, so a newer recommendation installs on the next machine run.
|
|
37
|
+
[bootstrap.hooks.post-packages]
|
|
38
|
+
description = "Install the drivers Ubuntu recommends for this hardware"
|
|
39
|
+
run = '''
|
|
40
|
+
for p in $(ubuntu-drivers list --recommended 2>/dev/null); do
|
|
41
|
+
dpkg-query -W -f='${db:Status-Abbrev}' "$p" 2>/dev/null | grep -q '^ii' || exec ubuntu-drivers install
|
|
42
|
+
done
|
|
43
|
+
'''
|
|
44
|
+
|
|
45
|
+
# grub.cfg is readable by root alone, so its age says whether it predates the
|
|
46
|
+
# settings above.
|
|
47
|
+
[bootstrap.hooks.final]
|
|
48
|
+
description = "Regenerate the boot menu when its settings changed"
|
|
49
|
+
run = "[ /boot/grub/grub.cfg -nt /etc/default/grub.d/90-fleet.cfg ] || update-grub"
|