Skip to content

Custom Apps

NoahRJ edited this page Jun 15, 2026 · 1 revision

Custom Apps

Since Iru resources must also contain metadata (e.g. active or name), each resource's on-disk representation is actually a directory of associated files. Certain files are required for a directory to be recognized as a resource.

Tip

Additional files, such as a README.md, can be added without causing issues so long as they cannot be confused with the required files.

Directory Structure

Each app requires:

  1. A directory within an iructl repository apps directory containing the app's files
  2. Exactly one info.[plist|yaml|json] file containing the app's metadata, including a file reference (the installer's name and sha256)
  3. The installer binary itself in the payload directory (payloads by default) -- not in the app directory -- whose name and contents match the file reference

An app may also include up to three optional scripts. Their filenames must start with audit, preinstall, and postinstall, respectively. An audit script is only valid when install_enforcement is continuously_enforce.

$ lsd --tree apps payloads
 apps
└──  MyApp
   ├──  audit.zsh
   ├──  info.yaml
   ├──  postinstall.zsh
   └──  preinstall.zsh
 payloads
└──  MyApp.pkg

apps/MyApp/info.yaml

id: 54bef6b3-b25e-44b4-89fd-d528d73939e4
name: MyApp
active: false
install_type: package
install_enforcement: continuously_enforce
restart: false
file:
  name: MyApp.pkg
  sha256: 07715b2ad9a33a0ab0f99892b40dc8a20e3f11dcd9e858bb92087cf56217fbed

audit.zsh

#!/bin/zsh -f

echo "Auditing MyApp..."
exit 0

preinstall.zsh

#!/bin/zsh -f

echo "Preparing to install MyApp..."
exit 0

postinstall.zsh

#!/bin/zsh -f

echo "Finished installing MyApp."
exit 0

Clone this wiki locally