tweak(cli): download package archives by default

From this point on, Straight will download packages from tarballs (if
possible) from their associated forge rather than clone them as git
repositories. This is (marginally) faster and consumes significantly
less space. Doom treats its packages as build artifacts anyway.

This shouldn't cause any immediate breakage, but it may upset folks who
want their local package installs to be repositories. For them, this can
be reversed by simply adding this to $DOOMDIR/init.el:

  (after! doom-straight
    (setq straight-vc-use-snapshot-installation nil))

This only applies to packages installed after this point. Packages that
are already cloned as a repo will stay that way until the next time
they're uninstalled or reinstalled from scratch. Plus it only works on
systems that have `tar` in their $PATH *and* forges that are
supported (at the time of writing: github, gitlab, codeberg, bitbucket,
and sourcehut).

Ref: radian-software/straight.el@4241b63952
This commit is contained in:
Henrik Lissner
2025-08-30 13:40:06 +02:00
parent 4b9f237250
commit 8cdddd87d9
3 changed files with 48 additions and 41 deletions

View File

@@ -55,7 +55,10 @@
;; no affect on packages that are pinned, however (run 'doom sync --gc' to
;; compact those after-the-fact). Some packages break when shallow cloned
;; (like magit and org), but we'll deal with that elsewhere.
straight-vc-git-default-clone-depth '(1 single-branch))
straight-vc-git-default-clone-depth '(1 single-branch)
;; Install archives from forges instead of cloning them. Much faster and
;; lighter.
straight-vc-use-snapshot-installation (and (executable-find "tar") t))
(with-eval-after-load 'straight
;; HACK: Doom relies on deferred compilation, which spares the user 20-50min