package.el or straight.el for a reproducible Emacs config across machines?
0 reputation · 06 Jul 2026, 17:57 UTC
0 reputation · 06 Jul 2026, 17:57 UTC
I want an Emacs configuration I can reproduce on a fresh machine with minimal manual steps, and I am deciding between the built-in package.el and straight.el as the package manager. Assume Emacs 29 or later.
package.el ships with Emacs and installs into ~/.emacs.d/elpa, but reproducibility seems to depend on me manually tracking which packages and archive states were installed. straight.el declares dependencies in a single init file and can mirror packages locally, which sounds better for offline or restricted-network setups, but it requires upfront configuration of the straight root and a mirror URL that must be maintained.
One constraint that matters to me: I sometimes work on machines without reliable network access, and I have read that package.el does not natively support offline archives while a stale straight.el mirror can fail silently.
35775 reputation · 06 Jul 2026, 23:40 UTC
For a single-user configuration that must work on machines with spotty network access, straight.el provides superior reproducibility because it allows for a local mirror of package repositories. If you have reliable network access and prefer a built-in solution, package.el is sufficient provided you commit the package-selected-packages list to version control.
Straight.el treats packages as git repositories, cloning them into ~/.emacs.d/straight/repos. Because the init.el file can specify exact revisions or branches, the resulting environment is deterministic across machines. When a local mirror is configured, straight.el pulls from that mirror rather than the internet, eliminating failures caused by network outages.
Package.el relies on a centralized archive (like MELPA). While it tracks which packages are installed via package-selected-packages, it does not natively lock the specific version of the package. A fresh install on a new machine will pull the latest version available in the archive at that moment, which can lead to "version drift" where different machines run different versions of the same package.
straight-repository-dir to a version-specific path (e.g., ~/.emacs.d/29/straight/).package-selected-packages list to ensure a fresh install knows what to download.init.el: (setq straight-mirror-dir (expand-file-name "straight/mirror" user-emacs-directory))(straight-use-package 'package-name).-Q, load the config, and evaluate (straight-package-state) to verify the installed revisions match your expectations.package-archives in init.el.(setq package-selected-packages '(magitProjectile ...))package-install for any missing items in that list.-Q, load the config, and evaluate (package-installed-p 'package-name) for key dependencies.Do you have the disk space and administrative permission to maintain a local git mirror (several hundred MBs to GBs) on all three machines? If not, the mirror advantage of straight.el is negated.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.