Use doomscript instead of cli.el for profile build

Our cli.el ended up in the profile used at runtime. Although we could
have fixed overwriting a user's cli.el by appending to it, that still
would have leaked our build commands into the build.

This approach should be equivalent and reduces our profile modifications
to replacing packages.el (which is kind of the point) and prepending to
init.el (unfortunate, but seemingly necessary).
This commit is contained in:
Marien Zwart 2024-04-25 16:23:55 +10:00
parent e41bb2e0e5
commit bc288fad83
No known key found for this signature in database
4 changed files with 74 additions and 65 deletions

View file

@ -0,0 +1,15 @@
#!/usr/bin/env doomscript
;; -*- lexical-binding: t; -*-
(defcli! build-profile-loader
((profile-name ("-n" form) "profile name.")
(profile-directory ("-p" dir) "profile data directory.")
(profile-doom-dir ("-d" dir) "doomdir"))
"write doom's profile loader."
(let ((new-profiles `((,profile-name
(user-emacs-directory . ,doom-emacs-dir)
(doom-profile-data-dir . ,profile-directory)
("doomdir" . ,profile-doom-dir)))))
(doom-profiles-save new-profiles)))
(run! "build-profile-loader" (cdr (member "--" argv)))