Packages and tools
Seven calls install software: Homebrew, the App Store, npm, mise, and GitHub releases.
niwa.brew.formula
niwa.brew.formula(name: string | { string } | { name: string, optional: boolean? }) -> Result | { Result }Install a Homebrew formula. niwa reads the receipts under the Homebrew prefix rather than asking brew, so checking a hundred formulae is a hundred directory reads. Pass a list to declare several at once, or a table with optional = true to let one failure stand without stopping the apply.
niwa.brew.cask
niwa.brew.cask(name: string | { string } | { name: string, optional: boolean? }) -> Result | { Result }Install a Homebrew cask. The three call shapes and the receipt check are the formula call, applied to applications.
niwa.brew.service
niwa.brew.service(name: string | { string }) -> ResultStart and keep a Homebrew service running. Declaring the service implies the formula, so you never write both.
niwa.mas.app
niwa.mas.app(apps: { [string]: number }) -> ResultDeclare App Store applications, by name and numeric id. This build declares and counts them; it does not check whether they are installed.
niwa.npm.global
niwa.npm.global(name: string | { string } | { name: string, optional: boolean? }) -> Result | { Result }Install a global npm package. The three call shapes are the ones the Homebrew calls take.
niwa.mise.tool
niwa.mise.tool(tools: { [string]: string }) -> ResultInstall development tools through mise, each with its version. The versions pin in niwa.lock, so every machine that shares the config installs the same one.
niwa.github_release
niwa.github_release(options: { repo: string, bin: string? }) -> ResultInstall a binary from a GitHub release. repo is "owner/name". bin is the bare file name to install when it is not the repository name, and it lands in ~/.local/bin. The version and its hash pin in niwa.lock.
Next
- Manage packages — install formulae, casks, global npm packages, tools, and release binaries
- Files and links — manage files, symlinks, and rendered templates
