+;;;###autoload
+(defun guix-package-from-file (file &optional profile)
+ "Display Guix package that the code from FILE evaluates to.
+If PROFILE is nil, use `guix-current-profile'.
+Interactively with prefix, prompt for PROFILE."
+ (interactive
+ (list (read-file-name "File with package: ")
+ (guix-ui-read-profile)))
+ (guix-buffer-get-display-entries
+ 'info 'package
+ (list (or profile guix-current-profile) 'from-file file)
+ 'add))
+