Skip to main content

Module deployment_map

Module deployment_map 

Source
Expand description

The deployment map.

The deployment map is a plain-text TSV under <data_dir>/deployment-map.tsv with a two-line #-comment preamble followed by one TSV row per datastore entry. An example file:

# dodot deployment map v1
# columns: pack\thandler\tkind\tsource\tdatastore
vim\tshell\tsymlink\t/home/alice/dotfiles/vim/aliases.sh\t/home/alice/.local/share/dodot/packs/vim/shell/aliases.sh
git\tsymlink\tsymlink\t/home/alice/dotfiles/git/gitconfig\t/home/alice/.local/share/dodot/packs/git/symlink/gitconfig

The file is overwritten on every dodot up / dodot down so it always matches the current datastore state. Its primary consumers are:

  • dodot refresh (see docs/proposals/magic.lex), which needs the source→deployed mapping to decide which source templates to mtime-touch when a deployed file diverges.
  • dodot probe deployment-map, the human-facing reader.

§Sources of truth

The map is derived from the datastore alone — we never re-run the handlers to regenerate it. This keeps the writer trivial and keeps the map honest: if the datastore has drifted from what the handlers would produce today, the map reflects the datastore (which is what the init script reads), not a hypothetical re-derivation.

Structs§

DeploymentMapEntry
One row in the deployment map.

Enums§

DeploymentKind
How a single datastore entry is materialised on disk.

Functions§

collect_deployment_map
Walk the datastore and collect one DeploymentMapEntry per visible entry under <data_dir>/packs/<pack>/<handler>/.
format_deployment_map
Format the deployment map as TSV.
read_deployment_map
Read and parse a deployment-map TSV file.
write_deployment_map
Collect, format, and write the deployment map to <data_dir>/deployment-map.tsv. Returns the written path.