unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: lgcoelho--- via Guix-patches via <guix-patches@gnu.org>
To: 68009@debbugs.gnu.org
Subject: [bug#68009] home-xdg-user-directories-service-type: Extend it with home-environment-variables service
Date: Sun, 24 Dec 2023 18:00:12 +0000	[thread overview]
Message-ID: <1dff17d3ef7bbc11c17b7e614cc96f16@disroot.org> (raw)


[-- 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


                 reply	other threads:[~2023-12-24 19:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1dff17d3ef7bbc11c17b7e614cc96f16@disroot.org \
    --to=guix-patches@gnu.org \
    --cc=68009@debbugs.gnu.org \
    --cc=lgcoelho@disroot.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).