Skip to content

brew

Declarative Homebrew package management. Define your formulae, casks, and Mac App Store apps as a Lua table — rootbeer generates a Brewfile and runs brew bundle to apply it.

lua
local brew = require("rootbeer.brew")

Example

lua
brew.config({
    formulae = { "git", "ripgrep", "fzf", "jq", "mise" },
    casks = { "ghostty", "raycast", "1password" },
    mas = {
        { name = "Things", id = 904280696 },
    },
})

For conditional packages per machine, see Multi-Device Config.

API Reference

config(cfg)

Generates a Brewfile at cfg.path and runs brew bundle to apply it.

casksstring[]optional
Homebrew casks to install.
formulaestring[]optional
Homebrew formulae to install.
masbrew.MasApp[]optional
Mac App Store apps to install.
pathstringoptional
Where to write the Brewfile. Defaults to "~/.config/Brewfile".

brew.MasApp

idnumber
Mac App Store ID.
namestring
Display name of the app.