The lockfile
Your config says what to install. archix.lock says exactly which build. With the same config and the same lock, two machines get the same package versions, today or a year from now.
The lock is a TOML file next to init.lua. Commit it. archix writes it; you don’t edit it by hand.
What’s in it
Section titled “What’s in it”One lockfile covers every host in your config. Each host gets its own section:
# Generated by archix: change it with `archix lock` or `archix update`.version = 1
[hosts.desktop]date = "2026-10-09"repos = ["core", "extra", "multilib"]declared = ["base", "firefox", "git", "neovim", "steam", "zen-browser-bin"]pinned = ["mesa"]
[hosts.desktop.packages]git = { version = "2.51.0-1", repo = "extra", file = "git-2.51.0-1-x86_64.pkg.tar.zst", sha256 = "e6674e96c7bbc318a40c1fd0008a6b00688683ce3d1b324544ebc9380885d098", explicit = true }glibc = { version = "2.42+r17+gd7274d718e6f-1", repo = "core", file = "glibc-2.42+r17+gd7274d718e6f-1-x86_64.pkg.tar.zst", sha256 = "fe91fe5179f421e133eb3026c3d84c0be076041f526d247f81226fddc5ff216b", explicit = false }mesa = { version = "1:25.3.1-1", repo = "archive", file = "mesa-1:25.3.1-1-x86_64.pkg.tar.zst", sha256 = "9b0c2f7e4d1a6c3b8e5f0a2d4c6e8b1a3f5d7c9e0b2a4c6e8d0f1a3b5c7e9d2f", explicit = false }zen-browser-bin = { version = "1.16.3b-1", repo = "aur", file = "zen-browser-bin-1.16.3b-1-x86_64.pkg.tar.zst", base = "zen-browser-bin", commit = "cd6266c6847e61c71facdd7dbf869b5cf64359be", explicit = true }zlib = { version = "1:1.3.1-2", repo = "core", file = "zlib-1:1.3.1-2-x86_64.pkg.tar.zst", sha256 = "314d62041028cade4a3f33c1e6ee79c950c08ca13e7ebd7f6467297ba94125dc", explicit = false }
[hosts.laptop]date = "2026-10-02"repos = ["core", "extra"]declared = ["base", "firefox", "git", "neovim", "tlp"]
[hosts.laptop.packages]# ...Each package is one inline table on one line, sorted by name, so a lock diff in git shows exactly which packages changed. Host and package names that aren’t plain letters, digits, - and _ are quoted, as in [hosts."my.laptop"] or "gtk+" = { ... }.
| Field | Meaning |
|---|---|
version (top level) |
The lock format version. A newer format is rejected with a clear error instead of being misread. |
date |
The Arch Linux Archive snapshot the host’s official packages come from. |
repos |
The official repos the host resolved against, in priority order. This is your repos option. |
declared |
The packages you declared, sorted. archix compares it with your config to see whether the lock is out of date. |
pinned |
Packages held at a version other than the snapshot’s. Only present when there are any. See Pins. |
packages |
One inline table per package, dependencies included, keyed by package name. |
version, file |
The exact package version and its package file. |
repo |
Where it comes from: an official repo such as core, a third-party repo by name, archive for a pin, aur, or local for a package built from the config’s own recipes. |
sha256 |
The checksum of the package file. A file that doesn’t match is never installed. For AUR and local packages, the first build’s, recorded once it’s built; see below. |
base, commit |
For AUR packages: the package base and the git commit of its build recipe. For local packages: local:<dir> or patch:<pkgbase>, and a hash of the recipe. See Local recipes and patched packages. |
sources |
For AUR and local packages, what the first build’s sources were: the commit of each git source and the sha256 of each download whose checksums are SKIP. See AUR packages. |
explicit |
Whether pacman marks it as explicitly installed or as a dependency. |
build_only |
true for an AUR package that’s only needed to build other AUR packages. It’s built, but never installed. |
recipes |
A fingerprint of each recipe in pkgbuilds/ and of each package’s patches, from when the lock was written. Only present when there are any. See Local recipes and patched packages. |
flatpak |
One inline table per Flatpak app, with its remote, ref and commit. Only present when the host declares apps. See Flatpak apps. |
Every host can sit on a different date. The laptop doesn’t have to update just because the desktop did.
Official repos: Arch Linux Archive snapshots
Section titled “Official repos: Arch Linux Archive snapshots”The Arch Linux Archive (ALA) keeps a full copy of the official repos for every day. archix locks your official packages to one of those days.
To resolve, archix runs pacman -Sp against that day’s sync databases and an empty local database, so the lock holds exactly the full set pacman would install on a fresh system. Providers you declare win: declare pipewire-jack and it replaces jack2. To pick a provider without declaring it, list it in prefer, such as rustup for rust; it’s installed as a dependency. Your /etc/pacman.conf stays on your live mirrors, for when you run pacman yourself.
When a dependency names a real package, the lock includes that package, even where pacman met the dependency with another package’s provides. pacman reuses a provider that’s already in the transaction, and on a fresh resolve that can be the wrong one: ca-certificates-utils provides ca-certificates but ships no certificates, and a lock with only it would empty the CA bundle. A provider still wins when you declare it or list it in prefer, and when the real package would conflict with something else in the lock. An existing lock picks this up on the next archix update, or when the declared packages change.
Official packages come from https://archive.archlinux.org unless archive_url names a mirror of it with the same layout, such as a local caching proxy. switch records the URL it used, so revert, which doesn’t evaluate the config, fetches from the same place. archive_mirrors lists more copies, tried in order when it’s down or lacks a file.
To install, archix downloads the exact files in the lock, checks each against its sha256, and hands them to pacman -U. It never mixes a snapshot with your live mirrors in one transaction, so you can’t end up with the partial upgrade the Arch wiki warns about.
The ALA also keeps every package version ever published under /packages/. So archix can fetch any exact version in the lock, even one that doesn’t belong to the snapshot date. That makes official packages always restorable.
A pin holds one package at a version other than the snapshot’s. Pins appear when archix locks to what’s already installed:
- when you adopt packages that
pacman -Syuor an AUR helper upgraded and no single snapshot matches them all; - when
archix inittakes over a system.
A pinned package is listed under pinned, and its entry has repo = "archive": archix fetches that exact version from the ALA’s /packages/ instead of the snapshot, and the sha256 is the checksum of the real file.
Pins survive archix lock at the same date, so adding a package doesn’t lose them. archix update to another date drops them, because the new snapshot replaces what they were holding.
How init picks the snapshot
Section titled “How init picks the snapshot”archix init locks to exactly what’s installed, so the first archix diff is empty. It starts from the newest build date among your installed official packages, then scores the sync databases of the days around it by how many installed versions they match, walking back and forth while the score improves. It keeps the best day. One partially upgraded package can’t drag the whole system onto a later snapshot that way.
Then it pins every installed version that differs from that snapshot, newer or older. AUR packages are locked to the commit whose recipe builds the installed version. If a pinned version can’t be fetched, init warns and keeps the snapshot’s version, which the first switch will then install. System-wide Flatpak apps are locked to the commits they’re installed at.
AUR packages: commits
Section titled “AUR packages: commits”An AUR package is a git repo of build files, so archix locks it by commit:
[hosts.desktop.packages]nodejs-lts-iron = { version = "20.19.5-1", repo = "aur", file = "nodejs-lts-iron-20.19.5-1-x86_64.pkg.tar.zst", base = "nodejs-lts-iron", commit = "5e1a7c93b0d24f68e1c3a5b7d9f0e2c4a6b8d0f1", explicit = false, build_only = true }zen-browser-bin = { version = "1.16.3b-1", repo = "aur", file = "zen-browser-bin-1.16.3b-1-x86_64.pkg.tar.zst", base = "zen-browser-bin", commit = "cd6266c6847e61c71facdd7dbf869b5cf64359be", explicit = true }version comes from that commit’s .SRCINFO, except for a VCS package such as a -git one, which sets its own version while building: the switch then writes the version the build produced into the lock and the generation, and says recorded the versions these packages gave themselves while building: .... The commit is what’s locked before anything is built, since AUR builds aren’t bit-for-bit reproducible. The first build then records what it made and what it built from: the switch writes the file’s sha256 into the lock, which a package cache’s copy has to match, and sources, the commit each git source was cloned at and the sha256 of each download whose checksums are SKIP:
neovim-git = { version = "0.12.0.r310.g1a2b3c4-1", repo = "aur", file = "neovim-git-0.12.0.r310.g1a2b3c4-1-x86_64.pkg.tar.zst", sha256 = "4f1c...", base = "neovim-git", commit = "8d2e...", sources = { "neovim::git+https://github.com/neovim/neovim.git" = "1a2b3c4d..." }, explicit = true }A later build of the same lock, on this machine after gc or on another one, checks out those commits and checks those downloads, so it builds the same code. archix update to a newer snapshot drops them, so the next build takes upstream’s newest code again. Each generation records the sha256 of the file it actually installed, so a revert reuses that exact file.
Dependencies the repos can satisfy are resolved from the repos; the rest come from the AUR. A name or dependency the locked snapshot lacks but the newest snapshot’s official repos have is refused instead of being taken from the AUR, since it’s simply too new for the lock: `cadical` isn't in the 2026-08-19 snapshot, but the newest one (2026-10-17) has it in the official repos, so it isn't taken from the AUR. Run `archix update` to lock a newer snapshot; nothing was changed. A recipe’s versioned dependency gets the same check, mytool needs `glibc>=2.44`, which isn't in the 2026-06-01 snapshot, but the newest one ..., so an AUR package providing glibc never stands in for it. An unversioned dependency that in fact needs newer libraries can’t be told apart before the build.
This check fails closed: when the archive can’t be reached to find the newest snapshot, locking stops instead of falling back to the AUR, so locking or updating with AUR packages needs the archive (or your archive_url mirror) reachable. Switching from a lock you already have resolves nothing and doesn’t. The refusal reads couldn't verify against the archive that `cadical` isn't simply too new for the 2026-08-19 snapshot (...), so it isn't taken from the AUR; nothing was changed.
An AUR package that only provides the name of a package your configured repos ship, the way glibc-eac provides glibc, never satisfies a dependency unless you declare it yourself: mytool needs `glibc>=9`, which the configured repos' glibc can't satisfy; only glibc-custom, an AUR package standing in for glibc, would, and archix doesn't swap a repo package for an AUR one unasked; nothing was changed. Declare glibc-custom in packages if that's what you want. Declaring it is the opt-in, and a declared provider is used over a more popular one. An AUR package needed only to build another one is build_only. Every recipe is shown for review before it enters the lock. See The AUR.
Local recipes and patched packages
Section titled “Local recipes and patched packages”Packages built from PKGBUILDs in the config have repo = "local". There’s no sha256, as with AUR packages, because the recipe is what’s locked:
[hosts.desktop.packages]backup-scripts = { version = "1.2.0-1", repo = "local", file = "backup-scripts-1.2.0-1-any.pkg.tar.zst", base = "local:backup-scripts", commit = "7f3c9a1e5b2d8046c1e9f7a3b5d2c8e0a4f6b1d3c5e7a9f2b4d6c8e0a1f3b5d7", explicit = true }hyprland = { version = "0.51.1-2.1", repo = "local", file = "hyprland-0.51.1-2.1-x86_64.pkg.tar.zst", base = "patch:hyprland", commit = "3a9e1c7b5d2f8046e1c3a5b7d9f0e2c4a6b8d0f1+c2e8a4f60b1d3e57", explicit = true }
[hosts.desktop.recipes]"local:backup-scripts" = "7f3c9a1e5b2d8046c1e9f7a3b5d2c8e0a4f6b1d3c5e7a9f2b4d6c8e0a1f3b5d7""local:wifi-firmware" = "builds:5d0b8e2f4a6c1e3b7d9f0a2c4e6b8d1f3a5c7e9b0d2f4a6c8e1b3d5f7a9c0e2b""patch:hyprland" = "c2e8a4f60b1d3e579a1c3e5f7b9d2f4a6c8e0b2d4f6a8c1e3b5d7f9a0c2e4b6d"local:<dir>is a recipe inpkgbuilds/<dir>/. Itscommitis a hash of the directory’s files, by path, contents and executable bit, leaving out makepkg’s output at the top of the directory (src/,pkg/,.SRCINFO,*.pkg.tar*and*.log) and.gitanywhere.patch:<pkgbase>is Arch’s recipe for that pkgbase with the config’spatches. Itscommitis the commit of Arch’s recipe,+, and the start of a hash of the patches. The version carries a pkgrel sub-release,2.1on top of Arch’s2.
The recipes table follows the host’s packages. It has an entry for every recipe in pkgbuilds/, keyed local:<dir>, and one for each patched package, keyed patch:<package>:
- A recipe the lock builds from is recorded by its content hash, the same as its packages’
commit. - Any other recipe is recorded as
builds:and a hash of the package names it builds andprovides, likelocal:wifi-firmwareabove. Editing such a recipe’s contents doesn’t touch the lock; adding a recipe, or changing what one builds, does, because it can change where a name resolves. - A patched package is recorded by the full hash of its patches.
archix compares the table with the config the way it compares declared, so editing a recipe the host uses or a patch makes the lock out of date: archix status says the config changed since the lock was written; `archix lock` or `archix switch` will re-resolve, and the next lock or switch resolves again. When the version stayed the same, the switch rebuilds the package anyway: reinstall backup-scripts 1.2.0-1 (a build from a different recipe).
archix update moves a patched package with the snapshot and rebuilds it for the new version. Local recipes only change when you change them.
Third-party repos: cached copies
Section titled “Third-party repos: cached copies”Third-party repos like CachyOS and chaotic-aur have no dated archive. archix resolves them at their live state, records the version and sha256 their database gives, and keeps a copy of every package file it installs from them in /var/cache/archix/pkg:
[hosts.desktop.packages]linux-cachyos = { version = "6.17.2-2", repo = "cachyos-core-v3", file = "linux-cachyos-6.17.2-2-x86_64_v3.pkg.tar.zst", sha256 = "037c07941f32cbc6746bf10bda7f2f6dbd00a6035eb46ab98fa5c000baf2197b", explicit = true }On the machine that made the lock, that’s as solid as an ALA snapshot. On a fresh machine it may not be, because the repo may no longer have that version, unless a package cache has it. Third-party repos explains what happens then.
Package caches
Section titled “Package caches”Every machine keeps its own copies in /var/cache/archix/pkg. A package cache shares them: a directory or web server that other machines try before the archive and the repos’ servers. archix cache push copies this machine’s package files, their signatures and its build records into a directory, such as a NAS mount, skipping files that are already there:
$ sudo archix cache push /mnt/nas/archixcopied 214 files to /mnt/nas/archixThe other machines list it in package_caches, as a file:// path or the URL of a web server that serves the directory:
package_caches = { "file:///mnt/nas/archix", "https://cache.example.org/archix" },What a cache does depends on the package:
- Official and third-party packages are looked for in each cache first, and checked against the lock’s
sha256like any download; a file that doesn’t match is skipped for the next source. For a third-party package the repo no longer serves, that’s what keeps the locked version restorable on a fresh machine. - AUR packages and builds of the config’s own recipes are reused rather than built. archix looks for the cache’s build record for the same recipe commit and snapshot, fetches the files it names, checked against the record’s hashes and the lock’s
sha256, and installs those,:: using zen-browser-bin's build from the package cache at .... One machine builds, the others don’t, and they all run the same build. A build that isn’t the one the lock records is passed over:warning: the package cache at file:///mnt/nas/archix has a build of zen-browser-bin that doesn't match archix.lock; building it here instead. Until a machine has built it, the lock has nosha256for it, and the record is trusted as it is: list only caches you control.
To have every switch fill a cache, set package_cache_push to its directory on the machine that builds. A cache that’s down or misbehaving only costs its speedup: archix says warning: skipping the package cache at ... and goes on to the archive or the repo. switch records the list, so revert, which doesn’t evaluate the config, tries the same caches when it fetches an older generation’s packages.
lock and update
Section titled “lock and update”Two commands write the lock. They differ in whether the snapshot date, the AUR commits and the Flatpak commits move. Neither changes the system.
archix lock keeps the host’s date and AUR commits, and resolves your current config against them. Use it after adding or removing packages. New packages come from the same day as everything else, so nothing else changes:
$ archix lockresolving 87 declared packages against the 2026-10-09 snapshot+ htop 3.4.1-1213 packages lockedwrote /etc/archix/archix.lockIf nothing changed, it says so and leaves the file alone:
$ archix lockarchix.lock is up to date for desktop (snapshot 2026-10-09)archix update moves the host to the newest snapshot, moves AUR packages to the newest commit of their recipes, and re-resolves. This is how you upgrade:
$ archix updateresolving 87 declared packages against the 2026-10-15 snapshotsnapshot 2026-10-09 -> 2026-10-15~ linux 7.2.8.arch1-1 -> 7.2.9.arch1-1~ mesa 1:25.3.0-1 -> 1:25.3.1-1- libnl-legacy 1.1.4-1212 packages lockedwrote /etc/archix/archix.lock+ is a new package, ~ a changed version, - a package that’s no longer needed. Changed AUR recipes are shown as a diff for review before the lock is written. The newest snapshot is the newest one the archive has published, so right after midnight it may still be yesterday’s.
A lock that’s never updated never gets security fixes. Once its snapshot is older than lock_warn_after_days, 30 by default, archix status and archix switch say so:
warning: archix.lock is at the 2026-09-10 snapshot, 38 days old; updates released since aren't installed. `archix update` moves it to the newest snapshotTo move to a specific day instead, pass --to. It works in both directions, which makes it a quick way to step a whole host back to a day you know was good. If that takes a package such as PostgreSQL back across a major version, the next switch asks first:
$ archix update --to 2026-10-01Both commands take --noconfirm to trust new AUR recipes without showing them. You rarely need lock on its own: archix switch locks first when the config changed. Run it when you want to review and commit the lock before switching, or to lock another host with --host.
archix diff shows what a switch would do with the current lock:
$ archix diffsnapshot 2026-10-15: 212 packagesupgrade linux 7.2.8.arch1-1 -> 7.2.9.arch1-1upgrade mesa 1:25.3.0-1 -> 1:25.3.1-1remove libnl-legacy 1.1.4-1 (not in the lock)Missing versions
Section titled “Missing versions”Official packages can always be fetched from the ALA. An AUR version can go missing: its commit disappears from the package’s history, or it no longer builds against the snapshot. When switch can’t build a locked AUR version, it offers the nearest newer version, then the nearest older one:
$ sudo archix switch...use the nearest newer version, foo-git 0.5.1-1? [Y/n]Whatever you accept is reviewed, then written back to the lock once it has actually built, so the next machine gets the same answer without being asked. If the version you accepted fails to build too, archix.lock stays as it was. If you accept neither, the switch stops before anything changes.
Policies
Section titled “Policies”Prompts don’t suit unattended runs. Set missing_versions to "newer" or "older" in your config, or pass it on the command line, and archix picks without asking:
$ sudo archix switch --accept-nearest newer$ sudo archix switch --accept-nearest older--accept-nearest overrides the option. --noconfirm with neither takes the nearest newer version.
Third-party repos have their own way out when a locked package is gone, the fallback chain; see Third-party repos.
Flatpak apps: commits
Section titled “Flatpak apps: commits”A Flatpak app is an OSTree commit on its remote, so archix locks it by commit. Hosts that declare flatpak.apps get a flatpak table after their packages, one inline table per app, keyed by app id:
[hosts.desktop.flatpak]"com.spotify.Client" = { remote = "flathub", ref = "app/com.spotify.Client/x86_64/stable", commit = "5f8806197a2b3c4d6e8f0a1b2c3d4e5f60718293a4b5c6d7e8f9012a3b4c5d6e" }"org.mozilla.firefox" = { remote = "flathub", ref = "app/org.mozilla.firefox/x86_64/stable", commit = "0bb3a9e40c1f8d2e4b6a7c9d1e3f5a7b9c0d2e4f6a8b1c3d5e7f9a0b2c4d6e8f" }| Field | Meaning |
|---|---|
remote |
The remote the app comes from: flatpak.remote, or the one named in remote:id. |
ref |
The app’s full Flatpak ref: app id, architecture and branch. |
commit |
The exact commit. switch installs the app and pins it there with flatpak update --commit=, even when the remote has something newer. |
The commits move like AUR commits do:
archix lockkeeps them, and locks a newly declared app to its remote’s current commit.archix updatechecks every app again and moves it to its remote’s current commit. An app whose remote can’t be reached keeps its commit:warning: couldn't check org.mozilla.firefox on flathub; keeping its locked commit.- An app that leaves the config leaves the lock.
lock and update ask the remote for the current commit through flatpak itself, and never add remotes. When a lock is written before flatpak is installed, or before an app’s remote has been added, the app has no entry yet; archix diff lists it as flatpak install <id>: ... with the reason, and the next switch adds the remote, locks the app and writes it into archix.lock.
Runtimes aren’t locked. An app’s runtime follows the branch the app’s metadata asks for, at that branch’s current commit when the app is installed or updated.
Each generation records the commits it pinned, so a revert pins the older ones again. See Flatpak and AppImages.
Fetched files: hashes
Section titled “Fetched files: hashes”Files declared with archix.fetchurl, AppImages included, don’t appear in archix.lock. Their sha256 is in your config, which is lock enough: a download that doesn’t match is refused, and the contents are kept in archix’s store with every generation that uses them.