(begin (use-modules (gnu build bootloader) (gnu build install) (guix build utils) (guix store) (guix utils) (ice-9 binary-ports) (srfi srfi-34) (srfi srfi-35)) (let* ((gc-root (string-append "/" %gc-roots-directory "/bootcfg")) (temp-gc-root (string-append gc-root ".new"))) (switch-symlinks temp-gc-root "/gnu/store/xlb81742i5sb4cdmidfhabprc17ijwck-grub.cfg") (install-boot-config "/gnu/store/xlb81742i5sb4cdmidfhabprc17ijwck-grub.cfg" "/boot/grub/grub.cfg" "/") (when #t (catch #t (lambda () ((lambda (bootloader efi-dir mount-point) (let ((grub-install (string-append bootloader "/sbin/grub-install")) (install-dir (string-append mount-point "/boot")) (target-esp (if (file-exists? (string-append mount-point efi-dir)) (string-append mount-point efi-dir) efi-dir))) (setenv "GRUB_ENABLE_CRYPTODISK" "y") (invoke/quiet grub-install "--boot-directory" install-dir "--bootloader-id=Guix" "--efi-directory" target-esp))) "/gnu/store/8hbf54vl9hfgbnfigbqcf0di1agajr88-grub-efi-2.04" "/boot/efi" "/")) (lambda args (delete-file temp-gc-root) (apply throw args)))) (rename-file temp-gc-root gc-root)))