2022-06-14 06:30:23 +02:00
|
|
|
(define-module (oni home services xinit)
|
|
|
|
#:use-module (srfi srfi-1)
|
|
|
|
#:use-module (gnu services configuration)
|
|
|
|
#:use-module (gnu home services)
|
|
|
|
#:use-module (gnu home services utils)
|
|
|
|
#:use-module (guix packages)
|
|
|
|
#:use-module (guix gexp)
|
|
|
|
#:use-module (oni gexp)
|
|
|
|
|
|
|
|
#:export (home-xinit-service-type
|
|
|
|
home-xinit-configuration
|
|
|
|
home-xinit-extension))
|
|
|
|
|
|
|
|
(define-configuration home-xinit-configuration
|
|
|
|
(wm
|
|
|
|
(text-config '())
|
|
|
|
"The window manager to start"))
|
|
|
|
|
|
|
|
(define-configuration/no-serialization home-xinit-extension
|
|
|
|
(wm
|
|
|
|
(text-config '())
|
|
|
|
"String"))
|
|
|
|
|
|
|
|
(define (xinit-home-files config)
|
2022-06-15 05:15:30 +02:00
|
|
|
`((".xinitrc"
|
2022-06-14 06:30:23 +02:00
|
|
|
,(mixed-executable-file
|
2022-06-15 05:15:30 +02:00
|
|
|
"xinitrc"
|
2022-06-14 06:30:23 +02:00
|
|
|
(serialize-text-config 'wm (home-xinit-configuration-wm config))))))
|
|
|
|
|
|
|
|
(define (home-xinit-extensions original-config extension-configs)
|
|
|
|
(home-xinit-configuration
|
|
|
|
(wm
|
|
|
|
(if (> (length extension-configs) 0)
|
|
|
|
(home-xinit-extension-wm (last extension-configs))
|
|
|
|
(home-xinit-configuration-wm original-config)))))
|
|
|
|
|
|
|
|
(define home-xinit-service-type
|
|
|
|
(service-type
|
|
|
|
(name 'home-xinit)
|
|
|
|
(extensions
|
|
|
|
(list (service-extension
|
|
|
|
home-files-service-type
|
|
|
|
xinit-home-files)))
|
|
|
|
(compose identity)
|
|
|
|
(extend home-xinit-extensions)
|
|
|
|
(default-value (home-xinit-configuration))
|
|
|
|
(description "Configure xinit.")))
|