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.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/emacs/guix-base.el b/emacs/guix-base.el
index aafa220f8b..5131eb0f87 100644
--- a/emacs/guix-base.el
+++ b/emacs/guix-base.el
@@ -816,6 +816,15 @@ Each element from GENERATIONS is a generation number."
(guix-make-guile-expression
'delete-generations* guix-current-profile generations))))
+(defun guix-switch-to-generation (generation)
+ "Switch `guix-current-profile' to GENERATION number."
+ (when (or (not guix-operation-confirm)
+ (y-or-n-p (format "Switch current profile to generation %d? "
+ generation)))
+ (guix-eval-in-repl
+ (guix-make-guile-expression
+ 'switch-to-generation guix-current-profile generation))))
+
(provide 'guix-base)
;;; guix-base.el ends here