(define-module (oni home services kdeconnect) #:use-module (gnu services configuration) #:use-module (gnu packages kde) #:use-module (gnu home services) #:use-module (gnu home services shepherd) #:use-module (gnu home services utils) #:use-module (guix packages) #:use-module (guix gexp) #:export (home-kdeconnect-service-type home-kdeconnect-configuration)) (define-configuration home-kdeconnect-configuration (package (package kdeconnect) "Package to use for setting kdeconnect")) (define (add-kdeconnect-packages config) (list (home-kdeconnect-configuration-package config))) (define (home-kdeconnect-shepherd-service config) (list (shepherd-service (documentation "Start kdeconnectd") (provision '(kdeconnectd)) (auto-start? #t) (start #~(make-forkexec-constructor (list #$(file-append (home-kdeconnect-configuration-package config) "/bin/kdeconnectd")) #:log-file (format #f "~a/.local/var/log/kdeconnectd.log" (getenv "HOME")))) (stop #~(make-kill-destructor))) (shepherd-service (documentation "Start kdeconnect") (provision '(kdeconnect)) (requirement '(kdeconnectd)) ;; (requirement '(statusbar)) (auto-start? #t) (start #~(make-forkexec-constructor (list #$(file-append (home-kdeconnect-configuration-package config) "/bin/kdeconnect-indicator")) #:log-file (format #f "~a/.local/var/log/kdeconnect.log" (getenv "HOME")))) (stop #~(make-kill-destructor))))) (define home-kdeconnect-service-type (service-type (name 'home-kdeconnect) (extensions (list (service-extension home-profile-service-type add-kdeconnect-packages) (service-extension home-shepherd-service-type home-kdeconnect-shepherd-service))) (compose identity) (default-value (home-kdeconnect-configuration)) (description "Install and configure kdeconnect.")))