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 (gnu home services utils)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix gexp) #:use-module (guix gexp)
#:use-module (oni home services xsession) #:use-module (oni home services xinit)
#:use-module (oni gexp) #:use-module (oni gexp)
#:use-module (srfi srfi-1) #:use-module (srfi srfi-1)
@ -98,11 +98,11 @@
(home-herbstluftwm-configuration-extra config)))))) (home-herbstluftwm-configuration-extra config))))))
(define (add-herbstluftwm-executable config) (define (add-herbstluftwm-executable config)
(home-xsession-extension (home-xinit-extension
(wm (wm
(list (list
(mixed-text-file (mixed-text-file
"xsession" "xinit"
"exec " herbstluftwm "/bin/herbstluftwm --autostart " (home-herbstluftwm-autostart-file config)))))) "exec " herbstluftwm "/bin/herbstluftwm --autostart " (home-herbstluftwm-autostart-file config))))))
(define home-herbstluftwm-service-type (define home-herbstluftwm-service-type
@ -113,7 +113,7 @@
home-profile-service-type home-profile-service-type
add-herbstluftwm-packages) add-herbstluftwm-packages)
(service-extension (service-extension
home-xsession-service-type home-xinit-service-type
add-herbstluftwm-executable))) add-herbstluftwm-executable)))
(compose identity) (compose identity)
(default-value (home-herbstluftwm-configuration)) (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) #:use-module (srfi srfi-1)
#:export (home-xsession-service-type #:export (home-xsession-service-type
home-xsession-configuration home-xsession-configuration))
home-xsession-extension))
(define-configuration home-xsession-configuration (define-configuration home-xsession-configuration
(configuration (configuration
(text-config '()) (text-config '())
"Configuration")) "Configuration"))
(define-configuration/no-serialization home-xsession-extension
(wm
(text-config '())
"String"))
(define (xsession-home-files config) (define (xsession-home-files config)
`((".xsession" `((".xsession"
,(mixed-executable-file ,(mixed-executable-file
"xsession" "xsession"
(serialize-text-config 'configuration (home-xsession-configuration-configuration config)))))) (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 (define home-xsession-service-type
(service-type (service-type
(name 'home-xsession) (name 'home-xsession)
@ -42,6 +29,5 @@
home-files-service-type home-files-service-type
xsession-home-files))) xsession-home-files)))
(compose identity) (compose identity)
(extend home-xsession-extensions)
(default-value (home-xsession-configuration)) (default-value (home-xsession-configuration))
(description "Configure xsession."))) (description "Configure xsession.")))