Mastodon Skip to content

How to split configuration into multiple files

This guide shows you how to include module configuration into your recipe from an external file. This is useful if you’re building multiple images or your recipe file is just getting cluttered.

  1. Create a new YAML file for your module(s) inside the recipes/ directory.
  2. Add your module configuration into the file.
    • The file can configure just one module like this:
      recipes/common-flatpaks.yml
      type: default-flatpaks
      system:
      install:
      - org.blender.Blender
    • Or it can configure multiple modules by declaring them under modules::
      recipes/common-modules.yml
      modules:
      - type: signing
      - type: files
      files:
      - usr: /usr
      - type: fonts
      fonts:
      nerd-fonts:
      - Hack
      - from-file: common-packages.yml
  3. Import your module configuration file in your recipe with from-file:.
    • Example:
      recipe.yml
      # ...rest of the recipe
      modules:
      - from-file: common-modules.yml
      - from-file: common-flatpaks.yml