dotfiles-guix/modules/home-services/virtualization.scm

40 lines
1.3 KiB
Scheme
Raw Normal View History

2023-09-06 16:02:40 +00:00
(define-module (home-services virtualization)
#:use-module (guix packages)
#:use-module (gnu packages)
#:use-module (gnu packages virtualization)
#:use-module (gnu packages firmware)
#:use-module (gnu services)
#:use-module (gnu services configuration)
#:use-module (gnu services virtualization)
#:use-module (gnu home services)
#:use-module (guix gexp))
(define my-libvirt
(package
(inherit libvirt)
(inputs
(modify-inputs (package-inputs libvirt)
(append ovmf)))))
2023-09-06 16:07:34 +00:00
2023-09-06 16:02:40 +00:00
(define (ovmf-special-files config)
`(("/usr/share/OVMF/OVMF_CODE.fd",
(file-append ovmf "/share/firmware/ovmf_x64.bin"))))
(define-public my-libvirt-service-type
(service-type
(name 'my-libvirt)
(extensions
(list
(service-extension libvirt-service-type
(lambda (config)
(libvirt-configuration
(libvirt my-libvirt)
(unix-sock-group "libvirt")))
)
(service-extension special-files-service-type
ovmf-special-files)
))
(default-value #f)
(description "Libvirt with OVMF")))