niwaniwa0.1.2
saru-id/niwa
niwaniwa

Services

Three calls run things: a launchd agent, a guarded command, and a body that runs once.

niwa.service

niwa.service(options: { label: string, program: { string }, interval: string?, calendar: { minute: number?, hour: number?, day: number?, weekday: number? }?, keepalive: boolean?, logs: string? }) -> Result

Declare a launchd agent. Exactly one schedule: interval, calendar, or keepalive. Two is an error, and none is an error.

niwa.run

niwa.run(command: string, options: { unless: boolean?, only_if: boolean?, creates: string?, timeout: string?, optional: boolean?, privileged: boolean? }?) -> Result

Run a command. This is the escape hatch, so a guard is required: unless, only_if, or creates. Without one, niwa refuses the config rather than run the command on every apply.

niwa.once

niwa.once(name: string, body: () -> ()) -> Result

Run a body exactly once on this machine. The journal keeps the marker, and the step is recorded as irreversible: undo will not take it back.

Next

↑↓ navigate · enter opens · esc closes