modules/ryan-packages/virtualization.scm
43ea80ea908a4c7070e09f70d4fc63acd34cdace
· 1.9 KB · 49 lines
raw
| 1 | ;;; Stolen from https://g.tylerm.dev/tylerm/dotfiles/raw/branch/main/modules/home-packages/virtualization.scm |
| 2 | |
| 3 | (define-module (ryan-packages virtualization) |
| 4 | #:use-module (guix packages) |
| 5 | #:use-module (guix utils) |
| 6 | #:use-module (gnu packages) |
| 7 | #:use-module (gnu packages package-management) |
| 8 | #:use-module (gnu packages build-tools) |
| 9 | #:use-module (gnu packages virtualization) |
| 10 | #:use-module (gnu packages firmware) |
| 11 | #:use-module (guix gexp)) |
| 12 | |
| 13 | (define ovmf-new |
| 14 | (package |
| 15 | (inherit ovmf) |
| 16 | (name "ovmf-new") |
| 17 | (arguments |
| 18 | (substitute-keyword-arguments (package-arguments ovmf) |
| 19 | ((#:phases phases) |
| 20 | #~(modify-phases #$phases |
| 21 | (replace 'install |
| 22 | (lambda _ |
| 23 | (let ((fmw (string-append #$output "/share/firmware"))) |
| 24 | (mkdir-p fmw) |
| 25 | (copy-recursively "Build/OvmfX64/RELEASE_GCC49/FV" fmw)))))))))) |
| 26 | |
| 27 | (define-public libvirt-new |
| 28 | (package |
| 29 | (inherit libvirt) |
| 30 | (name "libvirt-new") |
| 31 | (inputs |
| 32 | (modify-inputs (package-inputs libvirt) |
| 33 | (append ovmf-new))))) |
| 34 | |
| 35 | (define-public virt-manager-ovmf |
| 36 | (package |
| 37 | (inherit virt-manager) |
| 38 | (name "virt-manager-ovmf") |
| 39 | (arguments |
| 40 | (substitute-keyword-arguments (package-arguments virt-manager) |
| 41 | ((#:phases phases) |
| 42 | #~(modify-phases #$phases |
| 43 | (add-after 'install 'ovmf |
| 44 | (lambda _ |
| 45 | (let ((fmw (string-append #$output "/usr/share/OVMF"))) |
| 46 | (mkdir-p fmw) |
| 47 | (copy-recursively #$(file-append ovmf-new "/share/firmware") fmw) |
| 48 | ;(mkdir-p fmw) |
| 49 | (copy-recursively "Build/OvmfX64/RELEASE_GCC49/FV" fmw)))))))))) |