aboutsummaryrefslogtreecommitdiffstats
path: root/oni/home/services/flameshot.scm
diff options
context:
space:
mode:
Diffstat (limited to 'oni/home/services/flameshot.scm')
-rw-r--r--oni/home/services/flameshot.scm45
1 files changed, 45 insertions, 0 deletions
diff --git a/oni/home/services/flameshot.scm b/oni/home/services/flameshot.scm
new file mode 100644
index 0000000..7e02734
--- /dev/null
+++ b/oni/home/services/flameshot.scm
@@ -0,0 +1,45 @@
+(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.")))