* [bug#68009] home-xdg-user-directories-service-type: Extend it with home-environment-variables service
@ 2023-12-24 18:00 lgcoelho--- via Guix-patches via
0 siblings, 0 replies; only message in thread
From: lgcoelho--- via Guix-patches via @ 2023-12-24 18:00 UTC (permalink / raw)
To: 68009
[-- Attachment #1.1: Type: text/plain, Size: 585 bytes --]
Current home-xdg-user-directories-service-type creates a
~/.config/user-dirs.dirs which some non posix-compliant shells like fish
aren't able to read, this makes necessary to use some external tool like
fish-foreign-env, but this solution makes fish startup times really
slower in the case fish sources it in a non-login shell.
After thinking about it for a bit, I guess it would be proper if guix
itself was responsible for setting these environment variables. This
could avoid the need for users of other non-posix shells to make their
own custom workarounds for this problem.
[-- Attachment #1.2: Type: text/html, Size: 770 bytes --]
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-home-xdg-user-directories-service-type-Extend-it-wit.patch --]
[-- Type: text/x-diff; name=0001-home-xdg-user-directories-service-type-Extend-it-wit.patch, Size: 2192 bytes --]
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(+)
diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm
index 958772696b..e14870df05 100644
--- a/gnu/home/services/xdg.scm
+++ b/gnu/home/services/xdg.scm
@@ -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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-24 19:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-24 18:00 [bug#68009] home-xdg-user-directories-service-type: Extend it with home-environment-variables service lgcoelho--- via Guix-patches via
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.