2023-03-17 00:35:06 +01:00
|
|
|
(define-module (oni home services stumpwm)
|
|
|
|
#:use-module ((gnu services configuration)
|
|
|
|
#:select (serialize-package
|
|
|
|
define-configuration))
|
|
|
|
#:use-module ((gnu packages wm)
|
2023-03-17 08:33:19 +01:00
|
|
|
#:select (stumpwm
|
|
|
|
stumpish))
|
2023-03-17 00:35:06 +01:00
|
|
|
#:use-module ((gnu home services)
|
|
|
|
#:select (service-type
|
|
|
|
service-extension
|
|
|
|
home-profile-service-type
|
2023-03-17 08:33:19 +01:00
|
|
|
home-xdg-configuration-files-service-type
|
|
|
|
home-run-on-change-service-type))
|
2023-03-17 00:35:06 +01:00
|
|
|
#:use-module ((guix gexp)
|
2023-03-17 08:33:19 +01:00
|
|
|
#:select (local-file
|
|
|
|
gexp
|
|
|
|
file-append))
|
2023-03-17 00:35:06 +01:00
|
|
|
#:use-module ((guix packages)
|
|
|
|
#:select (package?))
|
|
|
|
|
|
|
|
#:export (home-stumpwm-service-type
|
|
|
|
home-stumpwm-configuration))
|
|
|
|
|
|
|
|
(define-configuration home-stumpwm-configuration
|
|
|
|
(package
|
|
|
|
(package stumpwm)
|
2023-03-17 08:33:19 +01:00
|
|
|
"Package to use for setting Stumpwm")
|
|
|
|
(stumpish-package
|
|
|
|
(package stumpish)
|
|
|
|
"Package to use for setting Stumpish"))
|
2023-03-17 00:35:06 +01:00
|
|
|
|
|
|
|
(define (add-stumpwm-packages config)
|
2023-03-17 08:33:19 +01:00
|
|
|
(list (home-stumpwm-configuration-package config)
|
|
|
|
(home-stumpwm-configuration-stumpish-package config)))
|
2023-03-17 00:35:06 +01:00
|
|
|
|
|
|
|
(define (home-stumpwm-config-files config)
|
|
|
|
`(("stumpwm/config" ,(local-file "stumpwm/config"))))
|
|
|
|
|
2023-03-17 08:33:19 +01:00
|
|
|
(define (reload-stumpwm-config-gexp _)
|
|
|
|
`(("files/.config/stumpwm/config"
|
|
|
|
,#~(system* #$(file-append stumpish "/bin/stumpish") "reload"))))
|
|
|
|
|
2023-03-17 00:35:06 +01:00
|
|
|
(define home-stumpwm-service-type
|
|
|
|
(service-type
|
|
|
|
(name 'home-stumpwm)
|
|
|
|
(extensions
|
|
|
|
(list (service-extension
|
|
|
|
home-profile-service-type
|
|
|
|
add-stumpwm-packages)
|
|
|
|
(service-extension
|
|
|
|
home-xdg-configuration-files-service-type
|
2023-03-17 08:33:19 +01:00
|
|
|
home-stumpwm-config-files)
|
|
|
|
(service-extension
|
|
|
|
home-run-on-change-service-type
|
|
|
|
reload-stumpwm-config-gexp)))
|
2023-03-17 00:35:06 +01:00
|
|
|
(compose identity)
|
|
|
|
(default-value (home-stumpwm-configuration))
|
|
|
|
(description "Install and configure stumpwm.")))
|