How the Dual-Package Build System Works in omarchy-pkgs
The omarchy-pkgs repository implements a dual-package build system that produces two separate Arch Linux packages—omarchy for runtime binaries and omarchy-settings for pre-install configuration files—from a single source checkout, ensuring version synchronization while avoiding file conflicts with upstream packages.
The dual-package build system separates the Omarchy desktop environment’s executable components from its system-wide configuration templates. This architecture, maintained in the basecamp/omarchy source tree alongside the companion omarchy-pkgs repository, allows the same Git commit to generate both the runtime package and the settings package. Understanding this split is critical for developers packaging Omarchy or modifying its installation pipeline.
Overview of the Dual-Package Architecture
The build system generates two distinct Arch packages with separate responsibilities:
omarchy– Contains runtime binaries (bin/), the Quickshell desktop environment, migration scripts, themes, and installation logic. Its build instructions reside inomarchy-pkgs/pkgbuilds/omarchy/PKGBUILD.omarchy-settings– Houses files that must exist before the main package installs, including/etc/skel/templates, system-wide drop-ins, fonts, Plymouth and SDDM themes, and branding assets. Its build instructions are located atomarchy-pkgs/pkgbuilds/omarchy-settings/PKGBUILD.
The PKGBUILDs are not stored in the main repository. Instead, they live in the separate omarchy-pkgs companion repository, which packages the source code found in basecamp/omarchy.
Build-Time Flow
The packaging process follows a strict sequence to maintain integrity between the two artifacts:
-
Checkout both repositories – Developers must clone both the main
omarchysource tree and theomarchy-pkgscompanion repository. -
Locate the PKGBUILD directory – The helper script
bin/omarchy-version-pkgsdiscovers the path to the PKGBUILDs, falling back to~/Work/omacom/omarchy-pkgs/pkgbuildsor a sibling../omarchy-pkgs/pkgbuildsdirectory. -
Execute
makepkg– The build runs separately for each PKGBUILD, producing theomarchyandomarchy-settingspackages. -
Install binaries and templates – The
omarchypackage installs executables to/usr/bin/omarchy-*and a symlink tree under/usr/share/omarchy/bin/. Theomarchy-settingspackage places seed files in/etc/skel/and override files in/usr/share/omarchy/etc-overrides/. -
Post-install configuration – The
omarchy-settingspackage runs apost_installscript that copies files from the override directory into their final locations under/etc/(such as/etc/bashrcand/etc/nsswitch.conf). This indirect installation prevents file conflicts with upstream Arch packages that own those paths.
Because both packages originate from the same source commit, a change to a default configuration in config/ automatically appears in the next omarchy-settings release, while a new binary added under bin/ appears in the next omarchy release.
Rationale for the Split
The dual-package approach solves three specific packaging constraints:
-
Separation of concerns –
omarchy-settingsmust be installed before theomarchypackage so thatuseradd -mcan copy the/etc/skel/templates when creating the initial user account. -
Avoiding file conflicts – Many files under
/etc/are owned by core Arch packages. By staging files in/usr/share/omarchy/etc-overrides/and copying them during post-install,omarchy-settingscan safely replace or augment system files without triggering pacman conflicts. -
Independent update cadence – The runtime package can be upgraded independently of the settings package, yet both remain version-matched because they are built from the same commit hash.
Key Implementation Files
Several source files define and verify this architecture:
-
docs/file-layout.md– Documents the mental model for the two-package split, explaining which directories map to which package. -
bin/omarchy-version-pkgs– Detects theomarchy-pkgscheckout location and reports the version used for the PKGBUILDs, ensuring the build system references the correct companion repository. -
test/shell.d/unowned-system-paths-test.sh– Validates that a checkout ofomarchy-pkgsis available, ensuring packaging coverage during continuous integration. -
omarchy-pkgs/pkgbuilds/omarchy/PKGBUILD– Defines the build process for the runtime package, specifying which directories (such asbin/,shell/,themes/) to include. -
omarchy-pkgs/pkgbuilds/omarchy-settings/PKGBUILD– Defines the build process for the settings package, targetingconfig/,skel/, and override directories.
Build Commands and Workflows
Building packages from side-by-side checkouts
# Assume the following directory structure:
# ~/Work/omarchy ← main source repository
# ~/Work/omarchy-pkgs ← companion repository with PKGBUILDs
cd ~/Work/omarchy-pkgs/pkgbuilds/omarchy
makepkg -si
cd ../omarchy-settings
makepkg -si
Locating the PKGBUILD directory programmatically
# Returns the path to the PKGBUILDs and the current version
omarchy-version-pkgs
# Example output:
# OMARCHY_PKGBUILDS_DIR="/home/user/Work/omarchy/omarchy-pkgs/pkgbuilds"
Linking a development checkout
# Symlinks the current source tree as the active development version
omarchy-dev-link
# This writes to /etc/omarchy.conf and updates secure_path so sudo
# sees the local binaries before they are packaged.
Updating both packages simultaneously
# Pull latest changes and rebuild both packages
git -C ~/Work/omarchy pull
git -C ~/Work/omarchy-pkgs pull
omarchy-update-system-pkgs # Builds both PKGBUILDs and runs pacman -U
Summary
- The dual-package build system generates
omarchyandomarchy-settingsfrom a single source commit inbasecamp/omarchy. - Runtime binaries ship in the
omarchypackage while pre-install configuration files ship inomarchy-settings. - The helper script
bin/omarchy-version-pkgslocates the companionomarchy-pkgsrepository containing the PKGBUILDs. omarchy-settingsuses an override directory and post-install copy mechanism to avoid file conflicts with upstream Arch packages.- Both packages remain version-synchronized because they are built from identical source checkouts.
Frequently Asked Questions
Why are the PKGBUILDs stored in a separate repository from the main source code?
The PKGBUILDs live in omarchy-pkgs to isolate Arch-specific build logic from the desktop environment’s source code. This separation allows the omarchy repository to remain distribution-agnostic while the companion repository handles packaging rules, dependencies, and Arch-specific installation hooks.
How does the build system handle files in /etc/ owned by other Arch packages?
The omarchy-settings package installs configuration templates to /usr/share/omarchy/etc-overrides/ rather than directly to /etc/. During installation, a post_install script copies these files into their final locations (such as /etc/bashrc or /etc/nsswitch.conf). This strategy prevents pacman from detecting file conflicts with core packages like filesystem or bash while still deploying the required system configurations.
Can I build and test these packages without installing them system-wide?
Yes. Developers can use omarchy-dev-link to symlink a local checkout as the active development source, bypassing the need for packaged installation during testing. Additionally, running makepkg in a side-by-side checkout of omarchy-pkgs builds local packages that can be installed with pacman -U without affecting the system-wide package database until you choose to upgrade.
What happens if the omarchy and omarchy-settings packages become out of sync?
While designed to be updated together from the same commit, the packages can technically be upgraded independently. However, version mismatches may cause configuration drift, as omarchy-settings contains the default user environment templates and system overrides that the omarchy runtime expects to be present. The bin/omarchy-version-pkgs script ensures both PKGBUILDs reference the same source version to prevent this drift during the build process.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →