From 21d8c958e83cab295a528fe141231149f3804077 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Mon, 18 Nov 2024 21:41:47 -0800 Subject: [PATCH] Add sawfish service code This should probably have been added earlier, but I seem to have missed it. --- oni/home/services/sawfish.scm | 49 +++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 oni/home/services/sawfish.scm diff --git a/oni/home/services/sawfish.scm b/oni/home/services/sawfish.scm new file mode 100644 index 0000000..1b87a99 --- /dev/null +++ b/oni/home/services/sawfish.scm @@ -0,0 +1,49 @@ +(define-module (oni home services sawfish) + #:use-module ((gnu services configuration) + #:select (define-configuration/no-serialization)) + #:use-module ((gnu home services) + #:select (service-type + service-extension + home-profile-service-type)) + #:use-module ((gnu packages sawfish) + #:select (sawfish)) + #:use-module ((guix gexp) + #:select (mixed-text-file)) + #:use-module ((guix packages) + #:select (package?)) + #:use-module ((oni home services xinit) + #:select (home-xinit-service-type + home-xinit-extension)) + + #:export (home-sawfish-service-type + home-sawfish-configuration)) + +(define-configuration/no-serialization home-sawfish-configuration + (package + (package sawfish) + "Package use for setting sawfish")) + +(define (add-sawfish-packages config) + (list (home-sawfish-configuration-package config))) + +(define (add-sawfish-executable config) + (home-xinit-extension + (wm + (list + (mixed-text-file + "xinitrc" + "exec " (home-sawfish-configuration-package config) "/bin/sawfish"))))) + +(define home-sawfish-service-type + (service-type + (name 'home-sawfish) + (extensions + (list (service-extension + home-profile-service-type + add-sawfish-packages) + (service-extension + home-xinit-service-type + add-sawfish-executable))) + (compose identity) + (default-value (home-sawfish-configuration)) + (description "Install and configure sawfish.")))