aboutsummaryrefslogtreecommitdiff
path: root/emacs/guix-base.el
diff options
context:
space:
mode:
Diffstat (limited to 'emacs/guix-base.el')
-rw-r--r--emacs/guix-base.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/emacs/guix-base.el b/emacs/guix-base.el
index 962010050b..658cfdb5fa 100644
--- a/emacs/guix-base.el
+++ b/emacs/guix-base.el
@@ -231,6 +231,20 @@ Ask a user with PROMPT for continuing an operation."
:dry-run? (or guix-dry-run 'f))
nil 'source-download)))
+(defun guix-build-package (package-id &optional prompt)
+ "Build package with PACKAGE-ID.
+Ask a user with PROMPT for continuing the build operation."
+ (when (or (not guix-operation-confirm)
+ (guix-operation-prompt (or prompt "Build package?")))
+ (guix-eval-in-repl
+ (format (concat ",run-in-store "
+ "(build-package (package-by-id %d)"
+ " #:use-substitutes? %s"
+ " #:dry-run? %s)")
+ package-id
+ (guix-guile-boolean guix-use-substitutes)
+ (guix-guile-boolean guix-dry-run)))))
+
;;;###autoload
(defun guix-apply-manifest (profile file &optional operation-buffer)
"Apply manifest from FILE to PROFILE.