From 67c4a901a3f861522d4efa27d0e8ead958f29a6b Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Tue, 5 Apr 2022 01:30:08 -0700 Subject: [PATCH] Add xsession configuration --- oni/home/data/config.scm | 14 ++++++++++++-- oni/home/services/xsession.scm | 31 +++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 oni/home/services/xsession.scm diff --git a/oni/home/data/config.scm b/oni/home/data/config.scm index 4271dda..b95d03e 100644 --- a/oni/home/data/config.scm +++ b/oni/home/data/config.scm @@ -10,7 +10,8 @@ #:use-module (guix gexp) #:use-module (oni home services xdisorg) #:use-module (oni home services xmodmap) - #:use-module (oni home services kitty)) + #:use-module (oni home services kitty) + #:use-module (oni home services xsession)) (home-environment (packages (list (specification->package+output "glibc-locales") @@ -208,4 +209,13 @@ (color6 . "#54a8a8") (color14 . "#abdddd") (color7 . "#969696") - (color15 . "#ededed")))))))) + (color15 . "#ededed"))))) + + (service home-xsession-service-type + (home-xsession-configuration + (configuration + (list + "xrdb -cpp m4 -merge \"${HOME}/.config/X11/Xresources\" -I\"${HOME}/.config/X11/Xresources.d\"" + "xrandr --setprovideroutputsource modesetting NVIDIA-0" + "xrandr --auto" + "xrandr --dpi 96"))))))) diff --git a/oni/home/services/xsession.scm b/oni/home/services/xsession.scm new file mode 100644 index 0000000..308106e --- /dev/null +++ b/oni/home/services/xsession.scm @@ -0,0 +1,31 @@ +(define-module (oni home services xsession) + #:use-module (gnu services configuration) + #:use-module (gnu home services) + #:use-module (gnu home services utils) + #:use-module (guix packages) + #:use-module (guix gexp) + + #:export (home-xsession-service-type + home-xsession-configuration)) + +(define-configuration/no-serialization home-xsession-configuration + (configuration + (text-config '()) + "Configuration")) + +(define (xsession-home-files config) + `(("xsession" + ,(mixed-text-file + "xsession" + (string-join (home-xsession-configuration-configuration config) "\n"))))) + +(define home-xsession-service-type + (service-type + (name 'home-xsession) + (extensions + (list (service-extension + home-files-service-type + xsession-home-files))) + (compose identity) + (default-value (home-xsession-configuration)) + (description "Configure xsession.")))