Facts
Seven values a config can read about the machine it runs on. They are gathered once per run, so twenty guards asking the same question cost one answer.
niwa.machine.name
niwa.machine.name: stringThe machine's short name, spelled the way hosts/<name>.luau expects it. Empty when the system will not say.
niwa.machine.owner
niwa.machine.owner: stringThe account's full name. Empty when the system will not say.
niwa.machine.arch
niwa.machine.arch: stringThe processor: "arm64" or "x86_64".
niwa.machine.os
niwa.machine.os: stringThe macOS version, as sw_vers reports it. Empty when the system will not say.
niwa.machine.tags
niwa.machine.tags: { [string]: boolean }This machine's tags, as a set: niwa.machine.tags.work is true when the tag is set. This is the one fact you author, through niwa tag.
niwa.brew.prefix
niwa.brew.prefix: stringWhere Homebrew lives: "/opt/homebrew" on Apple silicon, "/usr/local" otherwise. HOMEBREW_PREFIX wins when it is set to an absolute path.
niwa.home
niwa.home: stringThis run's home directory. Resource targets expand "~/" against it, so a rehearsal under --sandbox moves every path together.
Next
- Luau utilities — utility functions and generic resource definition
- The config and its modules — explain structure-from-layout, modules as groups, hosts as override
