diff --git a/oni/home/services/herbstluftwm.scm b/oni/home/services/herbstluftwm.scm index a563aa6..fd3a8df 100644 --- a/oni/home/services/herbstluftwm.scm +++ b/oni/home/services/herbstluftwm.scm @@ -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)) diff --git a/oni/home/services/xinit.scm b/oni/home/services/xinit.scm new file mode 100644 index 0000000..c290ce1 --- /dev/null +++ b/oni/home/services/xinit.scm @@ -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."))) diff --git a/oni/home/services/xsession.scm b/oni/home/services/xsession.scm index 9208235..049944d 100644 --- a/oni/home/services/xsession.scm +++ b/oni/home/services/xsession.scm @@ -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.")))