From d857c1cd7aa56de8721c8b8a75b204deb87fd40b Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Mon, 10 Jul 2023 20:04:37 +0200 Subject: Add systrays as a shepherd service. --- .config/guix/.gitignore | 1 + guix/jd/desktops/base.scm | 24 +++++++++-------- guix/jd/home/services/desktop.scm | 54 +++++++++++++++++++++++++++++++++++++++ guix/jd/home/services/udiskie.scm | 31 ---------------------- 4 files changed, 69 insertions(+), 41 deletions(-) create mode 100644 .config/guix/.gitignore create mode 100644 guix/jd/home/services/desktop.scm delete mode 100644 guix/jd/home/services/udiskie.scm diff --git a/.config/guix/.gitignore b/.config/guix/.gitignore new file mode 100644 index 0000000..46db10f --- /dev/null +++ b/.config/guix/.gitignore @@ -0,0 +1 @@ +current/ \ No newline at end of file diff --git a/guix/jd/desktops/base.scm b/guix/jd/desktops/base.scm index 69816fe..e95cbd0 100644 --- a/guix/jd/desktops/base.scm +++ b/guix/jd/desktops/base.scm @@ -1,7 +1,7 @@ (define-module (jd desktops base) #:use-module (jd packages vpn) #:use-module (jd home services polkit) - #:use-module (jd home services udiskie) + #:use-module (jd home services desktop) #:use-module (jd services polkit) #:use-module (gnu) @@ -10,22 +10,22 @@ #: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)) -(use-package-modules wm gnome gnupg) +(use-package-modules wm gnome gnupg networking) (use-service-modules cups desktop networking ssh xorg - docker virtualization pm sound) + docker virtualization pm sound dbus) (define-public %jd-base-home-services (list - (service home-xdg-mime-applications-service-type + (service home-xdg-mime-applications-service-type (home-xdg-mime-applications-configuration - (default '((inode/directory . emacs-desktop.desktop))) - (default '((application/pdf . emacs-desktop.desktop))) + (default '((inode/directory . emacs-desktop.desktop) + (application/pdf . emacs-desktop.desktop))) (desktop-entries (list (xdg-desktop-entry (file "emacs-desktop") @@ -43,8 +43,8 @@ (simple-service 'some-useful-env-vars-service home-environment-variables-service-type `(("GTK_THEME" . "Adwaita:dark") - ("VISUAL" . "emacsclient -a emacs") - ("EDITOR" . "emacsclient -a emacs") + ("VISUAL" . "emacsclient") + ("EDITOR" . "emacsclient") ("PATH" . "$HOME/.bin:$HOME/.npm-global/bin:$PATH") ("XDG_DATA_DIRS" . "$XDG_DATA_DIRS:$HOME/.local/share/flatpak/exports/share"))) @@ -58,7 +58,9 @@ (default-cache-ttl-ssh 28800) (max-cache-ttl-ssh 28800))) - (service home-udiskie-service-type) + (service home-dbus-service-type) + + (service home-desktop-service-type) (service home-polkit-gnome-service-type))) (define-public %jd-base-user-accounts @@ -104,6 +106,7 @@ (vpn-plugins (list network-manager-pptp)))) + (simple-service 'blueman dbus-root-service-type (list blueman)) (service bluetooth-service-type (bluetooth-configuration (auto-enable? #t))) @@ -126,6 +129,7 @@ polkit-network-manager-service (modify-services %desktop-services + (delete screen-locker-service-type) (delete network-manager-service-type)))) ;; Odin is a base for my operating systems diff --git a/guix/jd/home/services/desktop.scm b/guix/jd/home/services/desktop.scm new file mode 100644 index 0000000..bb4916e --- /dev/null +++ b/guix/jd/home/services/desktop.scm @@ -0,0 +1,54 @@ +(define-module (jd home services desktop) + #:use-module (gnu packages) + #:use-module (gnu packages freedesktop) + #:use-module (gnu packages networking) + #:use-module (gnu packages syncthing) + #:use-module (gnu packages gnome) + #:use-module (gnu services) + #:use-module (gnu services configuration) + #:use-module (gnu home services) + #:use-module (gnu home services shepherd) + #:use-module (gnu home services desktop) + #:use-module (guix gexp)) + +(define (desktop-profile-service config) + (specifications->packages '("udiskie" + "syncthing-gtk" + "network-manager-applet"))) + +(define (desktop-shepherd-services config) + (list (shepherd-service + (documentation "Udiskie daemon with tray.") + (provision '(udiskie)) + (start #~(make-forkexec-constructor + (list #$(file-append udiskie + "/bin/udiskie") + "-t"))) + (stop #~(make-kill-destructor))) + + (shepherd-service + (documentation "Syncthing daemon with tray.") + (provision '(syncthing-gtk)) + (start #~(make-forkexec-constructor + (list #$(file-append syncthing-gtk + "/bin/syncthing-gtk") + "-m"))) + (stop #~(make-kill-destructor))) + + (shepherd-service + (documentation "NetworkManager tray.") + (provision '(nm-applet)) + (start #~(make-forkexec-constructor + (list #$(file-append network-manager-applet + "/bin/nm-applet")))) + (stop #~(make-kill-destructor))))) + +(define-public home-desktop-service-type + (service-type (name 'home-udiskie) + (extensions (list (service-extension home-profile-service-type + desktop-profile-service) + (service-extension home-shepherd-service-type + desktop-shepherd-services))) + (default-value #f) + (description "Runs desktop services."))) + diff --git a/guix/jd/home/services/udiskie.scm b/guix/jd/home/services/udiskie.scm deleted file mode 100644 index ac8a16a..0000000 --- a/guix/jd/home/services/udiskie.scm +++ /dev/null @@ -1,31 +0,0 @@ -(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