dotfiles/oni/home/services/xdisorg.scm

56 lines
1.9 KiB
Scheme
Raw Normal View History

2024-10-29 08:17:48 +01:00
(define-module (oni home services xdisorg)
#:use-module ((gnu home services)
#:select (service-type
service-extension
home-profile-service-type))
#:use-module ((gnu home services shepherd)
#:select (home-shepherd-service-type
shepherd-service))
#:use-module ((gnu packages xdisorg)
#:select (xss-lock))
#:use-module ((gnu services configuration)
#:select (define-configuration
serialize-package))
#:use-module ((guix gexp)
#:select (gexp
file-append))
#:use-module ((guix packages)
#:select (package?))
#:export (home-xss-lock-configuration
home-xss-lock-service-type))
(define-configuration home-xss-lock-configuration
(package
(package xss-lock)
"Package to use for setting xss-lock"))
(define (add-xss-lock-packages config)
(list (home-xss-lock-configuration-package config)))
(define (home-xss-lock-shepherd-service config)
(list
(shepherd-service
(documentation "Start xss-lock")
(provision '(xss-lock))
(auto-start? #t)
(start
#~(make-forkexec-constructor
(list #$(file-append (home-xss-lock-configuration-package config) "/bin/xss-lock") "i3lock" "--" "--color" "222224")
#:log-file (format #f "~a/.local/var/log/xss-lock.log" (getenv "HOME"))))
(stop #~(make-kill-destructor)))))
(define home-xss-lock-service-type
(service-type
(name 'home-xss-lock)
(extensions
(list (service-extension
home-profile-service-type
add-xss-lock-packages)
(service-extension
home-shepherd-service-type
home-xss-lock-shepherd-service)))
(compose identity)
(default-value (home-xss-lock-configuration))
(description "Install and configure xss-lock.")))