(define-module (oni home services flameshot) #:use-module (gnu services configuration) #:use-module (gnu packages image) #: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-flameshot-service-type home-flameshot-configuration)) (define-configuration home-flameshot-configuration (package (package flameshot) "Package to use for settings flameshot")) (define (add-flameshot-packages config) (list (home-flameshot-configuration-package config))) (define (home-flameshot-shepherd-service config) (list (shepherd-service (documentation "Start flameshot") (provision '(flameshot)) (auto-start? #t) (start #~(make-forkexec-constructor (list #$(file-append (home-flameshot-configuration-package config) "/bin/flameshot")) #:log-file (format #f "~a/.local/var/log/flameshot.log" (getenv "HOME")))) (stop #~(make-kill-destructor))))) (define home-flameshot-service-type (service-type (name 'home-flameshot) (extensions (list (service-extension home-profile-service-type add-flameshot-packages) (service-extension home-shepherd-service-type home-flameshot-shepherd-service))) (compose identity) (default-value (home-flameshot-configuration)) (description "Install and configure flameshot.")))