47 lines
1.3 KiB
Scheme
47 lines
1.3 KiB
Scheme
(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)
|
|
`((".xinit"
|
|
,(mixed-executable-file
|
|
"xinit"
|
|
(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.")))
|