Read-only pull mirror of github.com/ublue-os/brew: the Homebrew integration Aurora's build copies from its image.
Find a file
Hec 6e905ce684 chore: remove useless tmpfiles.d configuration
This file creates 3 directories:
- /var/lib/homebrew
- /var/cache/homebrew
- /var/home/homebrew

The first 2 directories seem entirely useless. Grepping through the
entire homebrew codebase for mentions of those 2 directories nets
absolutely nothing.

The /var/home/homebrew directory here is problematic. It creates the
directory with the owner set to uid/gid 1000. This breaks usecases where
the user wants to change the owner of this directory, such as for
systems that utilize systemd-homed, or systems that utilize a new
project called brew-proxy.[1]

The directory is already created by brew-setup.service, and it does not
need to be created outside of that. If a user deliberately removes this
directory, it should not be recreated as an empty directory.

[1]: https://codeberg.org/HastD/brew-proxy

Signed-off-by: Hec <hec@heccraft.com>
2026-07-08 15:55:18 +02:00
.github fix: remove bootc label (#17) 2026-04-08 08:37:21 +03:00
system_files chore: remove useless tmpfiles.d configuration 2026-07-08 15:55:18 +02:00
BREW_VERSION feat: renovate for Brew versions (#8) 2026-03-31 07:44:14 +03:00
Containerfile fix: generate tarball and expose inside of OCI image instead of generating github releases 2025-12-13 16:03:08 -03:00
cosign.pub fix: Update cosign.pub for Universal Blue 2025-12-17 10:24:50 -08:00
Justfile init: first functional homebrew tarball generator 2025-12-13 15:50:10 -03:00
LICENSE init: first functional homebrew tarball generator 2025-12-13 15:50:10 -03:00
README.md fix: do not add to $PATH twice (#25) 2026-05-30 10:38:30 +03:00

The best way to bring homebrew to your custom bootc image!

Repository for generating Homebrew tarballs for redistribution on image-based systems via an OCI image. This includes general settings you'd want to use when using Homebrew on a bootc system, including a tarball and services for setting it up.

Overview

This repository builds an OCI container image that packages:

  • A pre-installed Homebrew tarball (homebrew.tar.zst)
  • Systemd services for automated setup, updates, and upgrades
  • Shell integration scripts (bash, fish)
  • Security limits and tmpfiles configuration

The image is designed to be consumed by custom bootc-based container images.

Dependencies

See upstream Docs

Using in Custom bootc Images

Basic Example

To include Homebrew in your custom bootc image, copy the files from this repository's OCI image:

# Copy Homebrew files from the brew image
# And enable
COPY --from=ghcr.io/ublue-os/brew:latest /system_files /
RUN --mount=type=cache,dst=/var/cache \
    --mount=type=cache,dst=/var/log \
    --mount=type=tmpfs,dst=/tmp \
    /usr/bin/systemctl preset brew-setup.service && \
    /usr/bin/systemctl preset brew-update.timer && \
    /usr/bin/systemctl preset brew-upgrade.timer

This will:

  1. Install the Homebrew tarball to /usr/share/homebrew.tar.zst
  2. Install all systemd services and timers
  3. Enable all systemd services and timers
  4. Add shell integration scripts
  5. Configure system limits and tmpfiles

On first boot, brew-setup.service will automatically:

  1. Extract Homebrew to /var/home/linuxbrew/.linuxbrew
  2. Set up proper permissions
  3. Make Homebrew ready to use

Systemd Services

brew-setup.service

Runs on first boot to extract and configure Homebrew:

  • Extracts tarball to /var/home/linuxbrew/.linuxbrew
  • Sets appropriate ownership (UID 1000)
  • Creates marker file to prevent re-running

brew-update.timer & brew-update.service

Automatically keeps Homebrew up to date:

  • Runs daily to update Homebrew itself
  • Ensures formula database is current

brew-upgrade.timer & brew-upgrade.service

Automatically upgrades installed packages:

  • Runs on a regular schedule
  • Keeps installed packages up to date

Shell Integration

  • Bash: /etc/profile.d/brew.sh - Automatically configures Homebrew environment
  • Fish: /usr/share/fish/vendor_conf.d/ublue-brew.fish - Fish shell support
  • Bash Completion: /etc/profile.d/brew-bash-completion.sh

Configuration Files

  • Security Limits: /etc/security/limits.d/30-brew-limits.conf
  • Tmpfiles: /usr/lib/tmpfiles.d/homebrew.conf
  • Systemd Presets: /usr/lib/systemd/system-preset/01-homebrew.preset

Known limitations

  • Launching desktops from the TTY causes linuxbrew to be present in non-interactive shells (krunner, rofi). See this.

How do I override system binaries with homebrew ones?

As discussed here, overriding system provided binaries can lead to some unexpected issues, but it might still be desirable to have a specific homebrew program that is also provided by the OS to take precedence over the system one.

Make an alias!

alias git='/home/linuxbrew/.linuxbrew/bin/git'