From f4232b4e088dec9c642e39846ab30e1303f53cb4 Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Thu, 6 Jul 2023 21:35:23 +0200 Subject: Add udiskie and home-xdg-mime home services. --- guix/jd/desktops/base.scm | 34 ++++++++++++++++++++++++++-------- guix/jd/home-services/polkit.scm | 31 ------------------------------- guix/jd/home/services/polkit.scm | 31 +++++++++++++++++++++++++++++++ guix/jd/home/services/udiskie.scm | 31 +++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+), 39 deletions(-) delete mode 100644 guix/jd/home-services/polkit.scm create mode 100644 guix/jd/home/services/polkit.scm create mode 100644 guix/jd/home/services/udiskie.scm (limited to 'guix/jd') diff --git a/guix/jd/desktops/base.scm b/guix/jd/desktops/base.scm index 5f21c47..69816fe 100644 --- a/guix/jd/desktops/base.scm +++ b/guix/jd/desktops/base.scm @@ -1,6 +1,7 @@ (define-module (jd desktops base) #:use-module (jd packages vpn) - #:use-module (jd home-services polkit) + #:use-module (jd home services polkit) + #:use-module (jd home services udiskie) #:use-module (jd services polkit) #:use-module (gnu) @@ -8,6 +9,8 @@ #:use-module (gnu home services) #:use-module (gnu home services desktop) #:use-module (gnu home services gnupg) + #:use-module (gnu home services xdg) + #:use-module (gnu services) #:use-module (nongnu packages linux) #:use-module (nongnu system linux-initrd)) @@ -19,28 +22,43 @@ (define-public %jd-base-home-services (list - (service home-redshift-service-type - (home-redshift-configuration - (location-provider 'manual) - (latitude 51.919438) - (longitude 19.145136))) ;; Poland + (service home-xdg-mime-applications-service-type + (home-xdg-mime-applications-configuration + (default '((inode/directory . emacs-desktop.desktop))) + (default '((application/pdf . emacs-desktop.desktop))) + (desktop-entries + (list (xdg-desktop-entry + (file "emacs-desktop") + (name "Emacs") + (type 'application) + (config + '((exec . "emacsclient -a emacs %u")))))))) + + (service home-redshift-service-type + (home-redshift-configuration + (location-provider 'manual) + (latitude 51.919438) + (longitude 19.145136))) ;; Poland (simple-service 'some-useful-env-vars-service home-environment-variables-service-type `(("GTK_THEME" . "Adwaita:dark") - ("VISUAL" . "emacsclient -a \"emacs -Q\"") - ("EDITOR" . "emacsclient -a \"emacs -Q\"") + ("VISUAL" . "emacsclient -a emacs") + ("EDITOR" . "emacsclient -a emacs") ("PATH" . "$HOME/.bin:$HOME/.npm-global/bin:$PATH") ("XDG_DATA_DIRS" . "$XDG_DATA_DIRS:$HOME/.local/share/flatpak/exports/share"))) (service home-gpg-agent-service-type (home-gpg-agent-configuration + (pinentry-program + (file-append pinentry "/bin/pinentry")) (ssh-support? #t) (default-cache-ttl 28800) (max-cache-ttl 28800) (default-cache-ttl-ssh 28800) (max-cache-ttl-ssh 28800))) + (service home-udiskie-service-type) (service home-polkit-gnome-service-type))) (define-public %jd-base-user-accounts diff --git a/guix/jd/home-services/polkit.scm b/guix/jd/home-services/polkit.scm deleted file mode 100644 index 699f2da..0000000 --- a/guix/jd/home-services/polkit.scm +++ /dev/null @@ -1,31 +0,0 @@ -(define-module (jd home-services polkit) - #:use-module (gnu packages) - #:use-module (gnu packages polkit) - #:use-module (gnu services) - #:use-module (gnu services configuration) - #:use-module (gnu home services) - #:use-module (gnu home services shepherd) - #:use-module (guix gexp)) - - -(define (polkit-gnome-profile-service config) - (specifications->packages '("polkit-gnome"))) - -(define (polkit-gnome-shepherd-service config) - (list (shepherd-service - (documentation "Polkit gnome service.") - (provision '(polkit-gnome)) - (start #~(make-forkexec-constructor - (list #$(file-append polkit-gnome - "/libexec/polkit-gnome-authentication-agent-1")))) - (stop #~(make-kill-destructor))))) - -(define-public home-polkit-gnome-service-type - (service-type (name 'home-polkit-gnome) - (extensions (list (service-extension home-profile-service-type - polkit-gnome-profile-service) - (service-extension home-shepherd-service-type - polkit-gnome-shepherd-service))) - (default-value #f) - (description "Runs the PolicyKit-gnome service."))) - diff --git a/guix/jd/home/services/polkit.scm b/guix/jd/home/services/polkit.scm new file mode 100644 index 0000000..327ee08 --- /dev/null +++ b/guix/jd/home/services/polkit.scm @@ -0,0 +1,31 @@ +(define-module (jd home services polkit) + #:use-module (gnu packages) + #:use-module (gnu packages polkit) + #:use-module (gnu services) + #:use-module (gnu services configuration) + #:use-module (gnu home services) + #:use-module (gnu home services shepherd) + #:use-module (guix gexp)) + + +(define (polkit-gnome-profile-service config) + (specifications->packages '("polkit-gnome"))) + +(define (polkit-gnome-shepherd-service config) + (list (shepherd-service + (documentation "Polkit gnome service.") + (provision '(polkit-gnome)) + (start #~(make-forkexec-constructor + (list #$(file-append polkit-gnome + "/libexec/polkit-gnome-authentication-agent-1")))) + (stop #~(make-kill-destructor))))) + +(define-public home-polkit-gnome-service-type + (service-type (name 'home-polkit-gnome) + (extensions (list (service-extension home-profile-service-type + polkit-gnome-profile-service) + (service-extension home-shepherd-service-type + polkit-gnome-shepherd-service))) + (default-value #f) + (description "Runs the PolicyKit-gnome service."))) + diff --git a/guix/jd/home/services/udiskie.scm b/guix/jd/home/services/udiskie.scm new file mode 100644 index 0000000..ac8a16a --- /dev/null +++ b/guix/jd/home/services/udiskie.scm @@ -0,0 +1,31 @@ +(define-module (jd home services udiskie) + #:use-module (gnu packages) + #:use-module (gnu packages freedesktop) + #:use-module (gnu services) + #:use-module (gnu services configuration) + #:use-module (gnu home services) + #:use-module (gnu home services shepherd) + #:use-module (guix gexp)) + +(define (udiskie-profile-service config) + (specifications->packages '("udiskie"))) + +(define (udiskie-shepherd-service config) + (list (shepherd-service + (documentation "udiskie daemon") + (provision '(udiskie)) + (start #~(make-forkexec-constructor + (list #$(file-append udiskie + "/bin/udiskie") + "-t"))) + (stop #~(make-kill-destructor))))) + +(define-public home-udiskie-service-type + (service-type (name 'home-udiskie) + (extensions (list (service-extension home-profile-service-type + udiskie-profile-service) + (service-extension home-shepherd-service-type + udiskie-shepherd-service))) + (default-value #f) + (description "Runs udiskie daemon."))) + -- cgit v1.2.3