Keyboard shortcuts

Press โ† or โ†’ to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Group Config

Groups are a tool for reusing configuration files across multiple hosts.

All configuration thatโ€™s shared between machines should be placed into groups. For instance, all machines might share the same base packages, shell configuration, or editor setup.

Groups are located in the top-level groups directory. The directory structure might look something like this:

 ๐Ÿ“‚ groups/
 โ”‚ ๐Ÿ“‚ base/
 โ”‚ โ”‚ ๐Ÿ“ shell/
 โ”‚ โ”‚ ๐Ÿ“ git/
 โ”‚ โ”‚ group.yml
 โ”‚ โ”” vars.yml
 โ”‚ ๐Ÿ“‚ laptop/
 โ”‚ โ”‚ ๐Ÿ“ upower/
 โ”‚ โ”‚ group.yml
 โ”‚ โ”” vars.yml
 โ”” ๐Ÿ“‚ games/
   โ”‚ group.yml
   โ”” vars.yml
 ๐Ÿ“ hosts/
  • The group.yml file is optional. It allows you to set group-specific configuration and specify packages that should be installed when this group is included.
  • All variables inside the vars.yml are exposed to the templating engine. Read the templating docs for detailed info. The top level of the vars.yml is expected to be an object.
  • All other files thatโ€™re located in a groupโ€™s directory are considered configuration files that should be deployed to the system. In the example above, that would be the shell, git, and upower folders.

Groups are enabled per host by adding them to the groups list in the host.yml.

group.yml

The following is a full example of a group.yml:

# Override the target directory for all files in this group.
# If not set, the global target directory is used.
target_directory: /etc

# Packages that should be installed when this group is enabled.
packages:
  pacman:
    - git
    - vim
    - neovim

# Defaults that should be applied to all files in this group.
defaults:
  owner: root
  group: root
  file_mode: 0o644
  directory_mode: 0o755
  • target_directory: PathBuf (optional) - Override the target directory for all configuration files in this group.
    • If itโ€™s a relative path, itโ€™s treated as relative to the global target directory.
    • If itโ€™s an absolute path, that absolute path is used.
  • packages: Map<String -> List<String>> (optional) - A list of packages sorted by package manager. Look at Package Management to see the list of available package managers.
  • defaults: (optional) Set default file permissions for all configuration files thatโ€™re inside this group directory.
    • owner: String - The fileโ€™s owner
    • group: String - The fileโ€™s assigned group
    • file_mode: OctalInt - The default permissions thatโ€™ll be set for all files.
    • directory_mode: OctalInt - The default permissions thatโ€™ll be set for all directories.