From 62ab490e6b55eec39e538cc974b9cd5fcf80923e Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 6 Oct 2022 23:21:43 -0700 Subject: [PATCH] Add flameshot service --- oni/home/rincewind/config.scm | 5 +++- oni/home/services/flameshot.scm | 45 +++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 oni/home/services/flameshot.scm diff --git a/oni/home/rincewind/config.scm b/oni/home/rincewind/config.scm index 2a0980e..e31d7fc 100644 --- a/oni/home/rincewind/config.scm +++ b/oni/home/rincewind/config.scm @@ -20,6 +20,7 @@ #:use-module (oni home services dunst) #:use-module (oni home services emacs) #:use-module (oni home services environment) + #:use-module (oni home services flameshot) #:use-module (oni home services kdeconnect) #:use-module (oni home services polybar) #:use-module (oni home services rofi) @@ -101,4 +102,6 @@ (service home-emacs-service-type (home-emacs-configuration - (package emacs-next)))))) + (package emacs-next))) + + (service home-flameshot-service-type)))) 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.")))