From f915f08c166ffdeaadfdd2438a66d8d0d3401629 Mon Sep 17 00:00:00 2001
From: Luis Guilherme Coelho <lgcoelho@disroot.org>
Date: Sun, 24 Dec 2023 14:43:38 -0300
Subject: [PATCH] home-xdg-user-directories-service-type: Extend it with
home-environment-service-type
---
gnu/home/services/xdg.scm | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
@@ -2,6 +2,7 @@
;;; Copyright © 2021, 2022 Andrew Tropin <andrew@trop.in>
;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
;;; Copyright © 2023 Bruno Victal <mirai@makinata.eu>
+;;; Copyright © 2023 Luis Guilherme Coelho <lgcoelho@disroot.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -256,12 +257,27 @@ (define (home-xdg-user-directories-activation-service config)
(map ensure-dir '#$dirs)
(display " done\n"))))
+(define (home-xdg-user-directories-environment-variables-service config)
+ (match-record config <home-xdg-user-directories-configuration>
+ (desktop documents music pictures videos publicshare download templates)
+ `(("XDG_DESKTOP_DIR" . ,desktop)
+ ("XDG_DOCUMENTS_DIR" . ,documents)
+ ("XDG_DOWNLOAD_DIR" . ,download)
+ ("XDG_MUSIC_DIR" . ,music)
+ ("XDG_PICTURES_DIR" . ,pictures)
+ ("XDG_PUBLICSHARE_DIR" . ,publicshare)
+ ("XDG_TEMPLATES_DIR" . ,templates)
+ ("XDG_VIDEOS_DIR" . ,videos))))
+
(define home-xdg-user-directories-service-type
(service-type (name 'home-xdg-user-directories)
(extensions
(list (service-extension
home-xdg-configuration-files-service-type
home-xdg-user-directories-files-service)
+ (service-extension
+ home-environment-variables-service-type
+ home-xdg-user-directories-environment-variables-service)
(service-extension
home-activation-service-type
home-xdg-user-directories-activation-service)))
--
2.41.0