(define-module (oni home services sawfish) #:use-module ((gnu services configuration) #:select (define-configuration/no-serialization)) #:use-module ((gnu home services) #:select (service-type service-extension home-profile-service-type)) #:use-module ((gnu packages sawfish) #:select (sawfish)) #:use-module ((guix gexp) #:select (mixed-text-file)) #:use-module ((guix packages) #:select (package?)) #:use-module ((oni home services xinit) #:select (home-xinit-service-type home-xinit-extension)) #:export (home-sawfish-service-type home-sawfish-configuration)) (define-configuration/no-serialization home-sawfish-configuration (package (package sawfish) "Package use for setting sawfish")) (define (add-sawfish-packages config) (list (home-sawfish-configuration-package config))) (define (add-sawfish-executable config) (home-xinit-extension (wm (list (mixed-text-file "xinitrc" "exec " (home-sawfish-configuration-package config) "/bin/sawfish"))))) (define home-sawfish-service-type (service-type (name 'home-sawfish) (extensions (list (service-extension home-profile-service-type add-sawfish-packages) (service-extension home-xinit-service-type add-sawfish-executable))) (compose identity) (default-value (home-sawfish-configuration)) (description "Install and configure sawfish.")))