Skip to content

Placements

A placement says where a zip item’s tree goes. A build may write only under its write roots.

placements.yaml sits at the repository root, next to catalogs/ and manifests/. It names the placements. Unknown fields are rejected. examples/placements.yaml shows every field.

placements:
meeting-backgrounds:
paths:
darwin: /Library/Application Support/Acme/Meeting Backgrounds
windows: ${USERPROFILE}\Pictures\Acme Meeting Backgrounds
scope:
windows: user
applies_to: [Video calls]
Field Meaning
key The placement name. Variants and the placements list of an item file use it.
paths The placement root, keyed by darwin and windows: a directory with one tree per item at <root>/<item_name>. A placement without paths is rootless (see Rootless placements).
scope machine or user, keyed like paths. An OS left out is machine. In user scope the per-user helper places the trees and writes the files. A rootless placement is machine only.
applies_to Display names, such as [Desktop]. Required, and different from the others, on each placement of an item that has two or more on an OS (see Choosing placements). The storefront shows a line such as “Applies to: Desktop” for an item, or labels the placement’s row on the detail page (see Storefront labels). Display only: it does not limit where an item is placed.
action_labels Optional storefront label overrides for the placement’s items. Keys: install, installing, installed, remove, removing, update, cancel, pending_install, pending_remove, applies_to.
exclusive Optional. When true, sofcat does not write into an existing, non-empty root it did not create.
items_dir Optional. Item trees go to <root>/<items_dir>/<item_name> instead. A clean relative path, slash-separated, each segment one Windows can hold, whose first segment does not start with ..
vars Optional. Any mapping, read by the placement’s templates as .Placement.Vars.
files Optional with paths, required without. Files rendered from the placement’s receipts, each a template or a template_file with a relative path or per-OS paths, or removed with ensure: absent (Placement files). A paths entry takes two more fields: scope: user has the per-user helper write that file for each signed-in user, even in a machine placement, and merge: add_if_absent adds keys to a JSON file the user also edits instead of owning it (Merging into a user’s file).
files_atomic Optional, with files. When true, no file is written unless every one renders and passes its checks; otherwise each is written on its own.
check_facts Top level, beside placements: facts for makecatalogs -check over the built-in samples, for the admin facts templates read.

Windows paths may use ${ProgramFiles} and ${ProgramData}. A path may use the user’s home, ${USERPROFILE} on Windows or ${HOME} on macOS, only when its OS has user scope.

Where order matters, placements are taken in file order.

A placement may have files and no paths. It holds no item trees: it only writes its files, such as a tool’s machine-wide config file.

placements:
claude-code-settings:
files:
- paths:
darwin: /Library/Application Support/ClaudeCode/managed-settings.json
template_file: templates/managed-settings.json.tmpl

Every files entry uses paths, one absolute path per OS; the relative path needs a root and is refused, and so are exclusive, items_dir and user scope. No item may target it: makecatalogs build and zip-item refuse an item that lists it, and makecatalogs -check refuses a variant that names it.

Every device that reads this placements.yaml gets the file, on every managed run, whatever its manifest lists. Differences between devices come from the template, through cond and fact. Its templates see no root (.Placement.Root is empty) and no items. A rootless placement is managed only: the storefront never shows it, and the per-user helper never sees it.

Each label key resolves from the item’s own custom_action_labels (the same ten keys), then from the first of the item’s placements, in file order, whose action_labels sets it, then from the storefront’s built-in label. Only placements with a variant for the machine’s OS count, for labels and for applies_to. An item’s applies-to line lists the union of those placements’ applies_to, in file order, without repeats, after the applies_to label (“Applies to” unless a layer sets it). The line is only text: it names where the item is meant to be used and never scopes the item, so a label such as “Works in” may read better. On the detail page of an item with two or more such placements, a row per placement takes the line’s place, labelled with that placement’s applies_to; see Choosing placements. For example:

placements.yaml
placements:
wallpapers:
applies_to: [Desktop]
action_labels: {install: Make available, remove: Withdraw, applies_to: Works in}
# paths, items_dir, vars and files left out
# packages-info/acme-wallpapers.yaml
custom_action_labels: {install: Enable for me}

The storefront shows “Enable for me” from the item, “Withdraw” from the placement, and the built-in “Cancel”, since neither sets cancel. The remove label stays “Remove” unless a layer sets remove. The applies-to line reads “Works in: Desktop”, from the placement.

pending_install and pending_remove word the status of a request waiting for the next run (“Will be installed”, “Will be removed”), which the card shows beside its Cancel button. Set them along with install and remove, so the status reads in the same words as the button that made the request.

An item with two or more placements that have a variant for the machine’s OS can be added to or removed from one of them. Its detail page (or dialog, with branding.item_view: dialog) lists the placements, each with its applies_to as the label, its status and one button: the item’s install label where it is not installed, remove where it is, and cancel beside the pending_install or pending_remove status of a placement waiting for the next run. The card stays as it was, except that an item installed in some of its placements but not all reads, for example, “Installed in Claude Code”, and its install button adds the item to the rest. An item with one placement on the OS shows the applies-to line as before.

The rows are told apart only by applies_to, so makecatalogs -check and makecatalogs build refuse an item with two or more placements on an OS when one of them has no applies_to or two of them have the same one.

The choice is stored for the machine, not per user, in the self-serve manifest’s placement_selections, beside selected_by. Removing an item from its last chosen placement removes it. A run places the item only in its chosen placements and removes it from any other it was placed in. An item an admin manifest lists in managed_installs goes to every placement, whatever was chosen. Taking a placement away is a removal, so it is allowed only to the user who added the item or an administrator.

A build writes only under its write roots. A brand sets them in write-roots.yaml, compiled into the binaries by just brand=<dir> build:

darwin: [/Library/Application Support/Acme]
windows: ['${ProgramData}\Acme']
windows_user: ['${USERPROFILE}\Pictures']
darwin_user: ['${HOME}/Pictures']

Without the file, a build uses ${ProgramData}\<NAME> on Windows and /Library/Application Support/<NAME> on macOS, the directory holding its config and Data, and has no user roots.

A root may name a single file, in write-roots.yaml or in managed policy. It allows that path, and nothing beside it. Until the file exists sofcat cannot tell it from a directory, so a path under it would also pass: name only the file itself in the repository’s placements.

A files entry with scope: user writes under a user root even when its placement is machine scope: a Claude Code user settings file needs ${HOME}/.claude/settings.json in darwin_user, and ${USERPROFILE}\.claude\settings.json in windows_user, set by the brand or by managed policy. The directory, ${HOME}/.claude, works too, but allows every file in it.

Managed policy can add roots to any build, stock or brand. It cannot remove the build’s. On Windows the policy is the key HKLM\SOFTWARE\Policies\<NAME>\WriteRoots, with the REG_MULTI_SZ values Machine and User:

Terminal window
$key = 'HKLM:\SOFTWARE\Policies\SofCat\WriteRoots'
New-Item -Path $key -Force
New-ItemProperty -Path $key -Name Machine -PropertyType MultiString -Value '${ProgramData}\Acme', 'C:\Tools\Acme'
New-ItemProperty -Path $key -Name User -PropertyType MultiString -Value '${USERPROFILE}\Pictures'

The single quotes keep PowerShell from expanding ${ProgramData} itself.

On macOS it is the WriteRoots dictionary, with Machine and User arrays of strings, in /Library/Managed Preferences/<IDENTIFIER>.plist. A configuration profile delivers it as a payload of type <IDENTIFIER>:

<dict>
<key>PayloadType</key><string>ca.hrndz.sofcat</string>
<key>PayloadIdentifier</key><string>com.acme.sofcat.writeroots</string>
<key>PayloadUUID</key><string>5D0C6A52-0E0B-4C8E-9F43-6B1E0C4A2F10</string>
<key>PayloadVersion</key><integer>1</integer>
<key>WriteRoots</key>
<dict>
<key>Machine</key>
<array>
<string>/Library/Application Support/Acme</string>
<string>/opt/acme</string>
</array>
<key>User</key>
<array><string>${HOME}/Pictures</string></array>
</dict>
</dict>

sofcat reads only the machine-level file, never the per-user ones under /Library/Managed Preferences/<user>, and ignores it unless root owns it and neither its group nor others can write it.

Policy entries follow the rules of write-roots.yaml: a machine root is an absolute path (on Windows it may use ${ProgramFiles} and ${ProgramData}), and a user root starts with ${USERPROFILE} or ${HOME} or is relative to the user’s home. sofcat drops an entry that breaks them and logs a warning naming it; a policy it cannot read or parse adds no roots. The service reads the policy at the start of every run and the per-user helper each time it starts, so a change needs no restart. A root you add applies from the next run. A root you remove is gone from the next run too. sofcat then refuses placements under it and leaves what it placed there alone. The service logs the roots in effect when it starts and whenever they change.

Writing either location takes an administrator or root. sofcat cannot tell a policy MDM or Group Policy delivered from one a local administrator wrote, and trusts both. config.yaml and the repository cannot add roots.

sofcat resolves symlinks in a placement path, then refuses it (placement_refused) when it is outside every root for its scope, inside sofcat’s data directory, or inside, equal to or around a directory holding sofcat’s binaries, so the stock root never overlaps Data or ${ProgramFiles}\<NAME>. An exclusive placement that exists, is not empty and lacks the marker file .<slug>-owned is refused too; a root sofcat creates gets the marker. A repository without placements.yaml fails every zip item with placement_refused.