[bug#79594] monad-repl: Add "build-graft" command.

Message ID b2c10a227320f8c6b59628806615d6c20a672cb4.1759830820.git.~@wolfsden.cz
State New
Headers
Series [bug#79594] monad-repl: Add "build-graft" command. |

Commit Message

Tomas Volf Oct. 7, 2025, 9:53 a.m. UTC
Grafts are not always required when just exploring in the REPL, and they do
take time, so this commit adds easy way to disable them.

* guix/monad-repl.scm (build-graft): New meta command.
* doc/guix.texi (Using Guix Interactively): Document it.
---
 doc/guix.texi       | 5 +++++
 guix/monad-repl.scm | 5 +++++
 2 files changed, 10 insertions(+)
  

Patch

diff --git a/doc/guix.texi b/doc/guix.texi
index 7162a5f06b..7e6a0d465a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -13214,6 +13214,11 @@  Using Guix Interactively
 @end example
 @end deffn
 
+@deffn {REPL command} build-graft @var{graft?}
+Set whether grafts should be performed as part of the build.  Equivalent
+to @code{--no-grafts} argument to @code{guix build}.
+@end deffn
+
 @deffn {REPL command} lower @var{object}
 Lower @var{object} into a derivation or store file name and return it.
 @end deffn
diff --git a/guix/monad-repl.scm b/guix/monad-repl.scm
index db4fe3c699..92f015a3b7 100644
--- a/guix/monad-repl.scm
+++ b/guix/monad-repl.scm
@@ -147,6 +147,11 @@  (define-meta-command ((build-options guix) repl (opts))
   (repl-print repl %build-options)
   (set! %build-options (repl-eval repl opts)))
 
+(define-meta-command ((build-graft guix) repl (graft?))
+  "build-graft GRAFT?
+Set whether grafts should be performed."
+  (%graft? (repl-eval repl graft?)))
+
 (define-meta-command ((enter-store-monad guix) repl)
   "enter-store-monad
 Enter a REPL for values in the store monad."