Configuration

Comtrya.yaml configures a run: where the manifests are, which ones run by default, variables, and a few defaults for actions. It's optional, and every option in it is too.

Where comtrya looks for it

The file is called Comtrya.yaml, Comtrya.yml or Comtrya.toml. Comtrya uses the first one it finds:

  1. the file given with -c, e.g. comtrya -c ~/dotfiles/Comtrya.toml apply. If it doesn't exist, comtrya stops with an error.
  2. the current directory
  3. your config directory: ~/.config on Linux, ~/Library/Application Support on macOS, %APPDATA% on Windows. The file sits directly in it, e.g. ~/.config/Comtrya.yaml.

With more than one of the three names in the same directory, comtrya takes them in the order above and warns about the others. A .toml file is read as TOML, anything else as YAML. An empty file is the same as no file.

Without any config file, the manifests are in the current directory.

Options

OptionTypeDefaultWhat it does
manifest_pathslist of paths or git URLsthe directory of the config filewhere the manifests are
default_manifestslist of manifest namesall manifestswhat comtrya apply runs without -m
ignorelist of globsnoneYAML and TOML files that aren't manifests
variablesmap of names to textnonevalues for manifests, {{ variables.<name> }}
include_variableslist of sourcesnonemore values from files, DNS or 1Password, {{ include_variables.<name> }}
package_providerprovider namethe usual one of the OSthe package manager for actions without provider
privilegesudo, doas or run0sudothe program that runs privileged actions
disable_update_checktrue or falsefalsedon't look for a newer comtrya at startup

Comtrya doesn't check the names of options yet: a misspelled one, like manifest_path, is ignored without a warning.

A complete example

# Comtrya.yaml
manifest_paths:
  - manifests
default_manifests:
  - shells.fish
  - apps.git
ignore:
  - "**/*.local.yaml"
variables:
  editor: nvim
include_variables:
  - "file+yaml:///home/me/dotfiles/secrets.yaml"
package_provider: homebrew
privilege: doas
disable_update_check: true

The same in TOML. Tables like [variables] go after the plain options:

# Comtrya.toml
manifest_paths = ["manifests"]
default_manifests = ["shells.fish", "apps.git"]
ignore = ["**/*.local.yaml"]
include_variables = ["file+yaml:///home/me/dotfiles/secrets.yaml"]
package_provider = "homebrew"
privilege = "doas"
disable_update_check = true

[variables]
editor = "nvim"

manifest_paths

Where the manifests are: a directory, or a git repository as an https://, git:// or ssh:// URL.

manifest_paths:
  - manifests                                     # relative to the config file
  # - https://github.com/me/dotfiles#main:manifests
  • A relative path is relative to the directory of the config file, not to the current directory.
  • Without manifest_paths, the manifests are in the directory of the config file.
  • A git URL takes #<branch>:<path> like -d does, see remote manifests.
  • -d wins over manifest_paths, and a path given with -d is relative to the current directory.
  • Only the first entry is used. More entries are ignored for now, without a warning.

default_manifests

The manifests comtrya apply runs when -m doesn't name any, with the manifests they depend on. Without it, apply runs all manifests. -m still runs the manifests it names instead. See Commands.

default_manifests:
  - dev.tools
  - shell

ignore

Globs of paths below the manifest directory that aren't manifests, like the YAML config of an app kept next to its manifest. Comtrya reads every other YAML and TOML file there as a manifest. The globs are relative to the manifest directory. See Which files are manifests.

ignore:
  - zsh/plugins        # the directory and everything in it
  - "**/*.local.yaml"  # in any directory

A glob that can't be read stops comtrya with an error.

variables

Values for manifests, as {{ variables.<name> }} in templates and variables.<name> in where. Values are text. -D name=value on the command line sets one too, and wins over the config. See Templating.

variables:
  editor: nvim
  font_size: "14"

include_variables

More variables, read from files, DNS TXT records or 1Password items, as {{ include_variables.<name> }}. A source that fails, like a 1Password CLI that isn't signed in, is left out with a warning. See Including variables.

include_variables:
  - "file+yaml:///home/me/dotfiles/variables.yaml"
  - "file+toml:///home/me/dotfiles/variables.toml"
  - "dns+txt://example.com"
  - "op://Private/Dotfiles"

package_provider

The package manager for package.install and package.repository actions that don't set provider, instead of the usual one of the OS. A provider on the action wins. See Default package provider.

package_provider: pkgin

privilege

The program comtrya starts for actions with privileged: true: sudo, doas or run0. See Privilege Escalation.

privilege: doas

disable_update_check

At startup, comtrya looks for a newer release and tells you about it. true turns that off, e.g. on machines without internet access or in CI.

disable_update_check: true