nix-doom-emacs-unstraightened/build-helpers/build-profile-loader
Marien Zwart bc288fad83
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).
2024-04-25 16:23:55 +10:00

15 lines
603 B
Text
Executable file

#!/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)))