Skip to content

brew

The brew module manages Homebrew packages from Lua. Declare your formulae, casks, and Mac App Store apps; Rootbeer generates a Brewfile and applies it with brew bundle.

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

Configure Homebrew

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

For packages that only belong on some machines, use Profiles.

API Reference

brew.config(cfg)

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

Parameterscfg: brew.Config

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.