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.ymlfile 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.ymlare exposed to the templating engine. Read the templating docs for detailed info. The top level of thevars.ymlis 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, andupowerfolders.
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 ownergroup:String- The fileโs assigned groupfile_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.