Host
The rb.host table provides information about the current machine and user. It is populated once at startup from POSIX syscalls — no environment variables are used.
lua
local rb = require("rootbeer")
if rb.host.os == "macos" then
-- macOS specific config
end
if rb.host.hostname == "work-macbook" then
-- work machine overrides
endAPI Reference
rootbeer.HostInfo
archstringCPU architecture (e.g.
"aarch64", "x86_64").homestringHome directory path (from passwd).
hostnamestringoptionalMachine hostname, or
nil if it cannot be determined.osstringThe operating system (e.g.
"macos", "linux").shellstringDefault login shell (from passwd, e.g.
"/bin/zsh").userstringCurrent username (from passwd).