Add sawfish service code

This should probably have been added earlier, but I seem to have missed it.
This commit is contained in:
Tom Willemse 2024-11-18 21:41:47 -08:00
parent 869528b295
commit 21d8c958e8

View file

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