Add xinit setting

It's a huge hack, but it works for now.
This commit is contained in:
Tom Willemse 2022-06-13 21:30:23 -07:00
parent 671659c7d2
commit 72d65a09e2
3 changed files with 52 additions and 19 deletions

View file

@ -6,7 +6,7 @@
#:use-module (gnu home services utils)
#:use-module (guix packages)
#:use-module (guix gexp)
#:use-module (oni home services xsession)
#:use-module (oni home services xinit)
#:use-module (oni gexp)
#:use-module (srfi srfi-1)
@ -98,11 +98,11 @@
(home-herbstluftwm-configuration-extra config))))))
(define (add-herbstluftwm-executable config)
(home-xsession-extension
(home-xinit-extension
(wm
(list
(mixed-text-file
"xsession"
"xinit"
"exec " herbstluftwm "/bin/herbstluftwm --autostart " (home-herbstluftwm-autostart-file config))))))
(define home-herbstluftwm-service-type
@ -113,7 +113,7 @@
home-profile-service-type
add-herbstluftwm-packages)
(service-extension
home-xsession-service-type
home-xinit-service-type
add-herbstluftwm-executable)))
(compose identity)
(default-value (home-herbstluftwm-configuration))

View file

@ -0,0 +1,47 @@
(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.")))

View file

@ -8,32 +8,19 @@
#:use-module (srfi srfi-1)
#:export (home-xsession-service-type
home-xsession-configuration
home-xsession-extension))
home-xsession-configuration))
(define-configuration home-xsession-configuration
(configuration
(text-config '())
"Configuration"))
(define-configuration/no-serialization home-xsession-extension
(wm
(text-config '())
"String"))
(define (xsession-home-files config)
`((".xsession"
,(mixed-executable-file
"xsession"
(serialize-text-config 'configuration (home-xsession-configuration-configuration config))))))
(define (home-xsession-extensions original-config extension-configs)
(home-xsession-configuration
(inherit original-config)
(configuration
(append (home-xsession-configuration-configuration original-config)
(home-xsession-extension-wm (last extension-configs))))))
(define home-xsession-service-type
(service-type
(name 'home-xsession)
@ -42,6 +29,5 @@
home-files-service-type
xsession-home-files)))
(compose identity)
(extend home-xsession-extensions)
(default-value (home-xsession-configuration))
(description "Configure xsession.")))