System settings
Six calls declare what macOS itself does: preference domains, the Dock, the Finder, and three machine-wide settings.
niwa.defaults
niwa.defaults(domain: string, values: { [string]: Plist }, options: { restart: string? }?) -> ResultSet keys in a preference domain, user or /Library. Each key is its own resource, so two modules can declare different keys of one domain and only a real collision is a conflict. restart names the application to restart once the keys change.
niwa.dock
niwa.dock(settings: { autohide: boolean?, tilesize: number?, apps: { string }?, minimize_effect: ("genie" | "scale" | "suck")? }) -> ResultDeclare the Dock. It is sugar over defaults for the four settings people change, and it restarts the Dock for you.
niwa.finder
niwa.finder(settings: { show_hidden: boolean?, default_view: ("list" | "icon" | "column" | "gallery")?, path_in_title: boolean? }) -> ResultDeclare the Finder. The same sugar as the Dock call, for three settings.
niwa.hosts
niwa.hosts(entries: { [string]: string }) -> ResultDeclare entries in /etc/hosts. Keys are host names, values are addresses, and each entry is its own resource. Lines you did not declare stay where they are.
niwa.login_shell
niwa.login_shell(path: string) -> ResultSet the login shell. It adds the path to /etc/shells and runs chsh, and it needs administrator rights.
niwa.hostname
niwa.hostname(name: string) -> ResultSet the machine's hostname. It needs administrator rights.
Next
- Manage system settings — declare defaults, dock, and finder, and know what restarts
- Services — manage launchd services and scheduled jobs
