From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id eC7WGcaZlmOFIwEAbAwnHQ (envelope-from ) for ; Mon, 12 Dec 2022 04:02:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id MGnjGcaZlmNkoQAA9RJhRA (envelope-from ) for ; Mon, 12 Dec 2022 04:02:30 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B6F1F19C19 for ; Mon, 12 Dec 2022 04:02:29 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4Z4w-00035n-BE; Sun, 11 Dec 2022 22:02:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4Z4s-00034r-Ox for guix-patches@gnu.org; Sun, 11 Dec 2022 22:02:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p4Z4s-0008HL-Ge; Sun, 11 Dec 2022 22:02:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p4Z4s-0006i4-60; Sun, 11 Dec 2022 22:02:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#59983] [PATCH] home: Let user configure XDG base directories. Resent-From: Antero Mejr Original-Sender: "Debbugs-submit" Resent-CC: ludo@gnu.org, guix-patches@gnu.org Resent-Date: Mon, 12 Dec 2022 03:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 59983 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 59983@debbugs.gnu.org Cc: Antero Mejr , ludo@gnu.org X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: ludo@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167081409025775 (code B ref -1); Mon, 12 Dec 2022 03:02:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Dec 2022 03:01:30 +0000 Received: from localhost ([127.0.0.1]:49803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4Z4M-0006hf-7Y for submit@debbugs.gnu.org; Sun, 11 Dec 2022 22:01:30 -0500 Received: from lists.gnu.org ([209.51.188.17]:56714) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p4Z4K-0006hZ-OD for submit@debbugs.gnu.org; Sun, 11 Dec 2022 22:01:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4Z4F-0002pR-9L for guix-patches@gnu.org; Sun, 11 Dec 2022 22:01:28 -0500 Received: from mout-p-201.mailbox.org ([2001:67c:2050:0:465::201]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1p4Z4C-00081s-Cs for guix-patches@gnu.org; Sun, 11 Dec 2022 22:01:22 -0500 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4NVmbq5yjgz9sNY for ; Mon, 12 Dec 2022 04:01:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1670814071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=aZ2xl2oADxz9PHLPcELvKloVIqFDGCUI6gCV/ny3SFQ=; b=PGzXQV4rG5kOb7qDCDAbOPLejTmLux5O8CR7HeXu0OjAvbfI87oBq07wZVOa99NrJmzhzU mtepoB3DLkiS5V5PDipD4pS1QQGtB7JR0PNwsAT+DTDBbKvzkTOov/6w/d81a9QHcpbHge Nk/eDlMd/ctWFaBxGW/EMtJ7Pnq4bMkJEnOQezUKSu4NpL1xV1S/4Bsbh4a1KuMu8WbE/Y BDxpF9WRnPHuhN6qr/Lna0SeIg3hdkBj4OMzE9OGwlkeKb+fDq65G6Iw1O+CmlycUFI8wW w8xR3ZvLSJHTFmxwqLtpgVHHctL3JVSxA2UQorjrN6Phxd4qmHpRdvOnCjcklA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1670814067; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=aZ2xl2oADxz9PHLPcELvKloVIqFDGCUI6gCV/ny3SFQ=; b=jqgwiPa/HdLGj0HO/KQn/mQT4+ParFda62rYOIU37PomZvsSYGN2UsQEH4FVfLjdf6FPzm FmFMzyM1vNtv1JvI8T3psBVNh20Rkfjb9ijILiCWmH4LcI3kA7uuSYAtntkJHbKZegYIHT XFv68BjcCFmSdp42VTV1N/ZqusU1zjI0lhjID3KEhKDxjJaaVl0+wv0dzmMpULDwYYjRfA HqlNcQC0Nsgx7BEc1tpwLyfL8m91io8pEhVWLOiFs991IegqtnDF/uFla9bOiDhAQGqAoE elQgqVpFybZ6/Ih1fkNq7W6VoRmkU4d2183bnQTWLkcczFlsLLATJq2oqXWdKQ== Date: Mon, 12 Dec 2022 03:00:49 +0000 Message-Id: <20221212030049.4725-1-antero@mailbox.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MBO-RS-META: 5tsq4bqg6acy3o8zus67bdf8imbcq6zr X-MBO-RS-ID: de8c7fb73d939f0086c X-Rspamd-Queue-Id: 4NVmbq5yjgz9sNY Received-SPF: pass client-ip=2001:67c:2050:0:465::201; envelope-from=antero@mailbox.org; helo=mout-p-201.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Antero Mejr X-ACL-Warn: , Antero Mejr via Guix-patches From: Antero Mejr via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670814150; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=aZ2xl2oADxz9PHLPcELvKloVIqFDGCUI6gCV/ny3SFQ=; b=pVUQ5ztA01llOKnnZghf1Du/psg8rPph3p9oeJdu97EcyYz466A963nuF8Vs3BCawzWPsc rvCsJ5AWu+6Mkxo+sW8/FQCeTgpH/8399PJEfRODdSGKSgEQuLK2joXdOc9gI/84svqvxA /J/KjDs8nX3SoovCTZCIb+QrgnEDkOd9i2/kxVa4GxZ3/o8xmmyapVygQQI5iOgvgWfNft c1mV62PQr/OQbndV3MKa20sUE8Of32fpyrglOA7OY2Ad4leA4ZOLRsSkCp0z7N4sSZ3Q9q 8tGnwip/3CIKr3oRbfwKEA11OlVN3b8cxjuar3rad2O9SGNR6DDpTe7Kbxe5qw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mailbox.org header.s=mail20150812 header.b=PGzXQV4r; dkim=fail ("headers rsa verify failed") header.d=mailbox.org header.s=mail20150812 header.b="jqgwiPa/"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670814150; a=rsa-sha256; cv=none; b=KVdLC6tbr5v/eKm3tm1ebQ5MUZ70BC/1Fp0C9NpAcX/nSxmUH7SZBA34/koNVpR+8gKis8 +r6mbzWd7WSs1JsJU3bqfGC42IdD4rMRt+0P0vfo/Rw36220ynj9FBa+HKbvsDsGD3BGQK IpB0LifWFbawQiJ5J591m+VGbDLlEYRWV82HNc07GXlZP27Rvb5WRaJdY7xrQhwNltcdjg aPNyFtDWiKMGtT8Ux0KF7KfcOfXeBWAWAQcyTyzcsLpqbIHTXIGDcrzvDcMTHE3Yfyf6LH tSnSyk8hrR/XiRub+/NNNWNb3dMNJ3XjZDlkOA0lzm1v7UXN82h4qFjl0UUn9w== X-Migadu-Spam-Score: -3.35 X-Spam-Score: -3.35 X-Migadu-Queue-Id: B6F1F19C19 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mailbox.org header.s=mail20150812 header.b=PGzXQV4r; dkim=fail ("headers rsa verify failed") header.d=mailbox.org header.s=mail20150812 header.b="jqgwiPa/"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org X-TUID: AidtxLVSlGWD * gnu/home.scm (home-environment)[base-xdg-configuration]: New field. * gnu/home/services/xdg.scm (ensure-xdg-base-dirs-on-activation): Make XDG_RUNTIME_DIR directory if the configuration changes it from the default. --- Allows making a runtime dir at ~/.local/runtime (or any other dir), so users don't have to set up elogind or other greeters/PAM modules. gnu/home.scm | 9 +++++++-- gnu/home/services/xdg.scm | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gnu/home.scm b/gnu/home.scm index c95d1e0818..f100b575e3 100644 --- a/gnu/home.scm +++ b/gnu/home.scm @@ -39,6 +39,7 @@ (define-module (gnu home) home-environment-essential-services home-environment-services home-environment-location + home-environment-base-xdg-configuration home-environment-with-provenance @@ -71,7 +72,10 @@ (define-record-type* home-environment (location home-environment-location ; (default (and=> (current-source-location) source-properties->location)) - (innate))) + (innate)) + + (base-xdg-configuration home-environment-base-xdg-configuration + (default (home-xdg-base-directories-configuration)))) (define (home-environment-default-essential-services he) "Return the list of essential services for home environment." @@ -83,7 +87,8 @@ (define (home-environment-default-essential-services he) (service home-symlink-manager-service-type) (service home-fontconfig-service-type) - (service home-xdg-base-directories-service-type) + (service home-xdg-base-directories-service-type + (home-environment-base-xdg-configuration he)) (service home-shell-profile-service-type) (service home-service-type) diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm index 865f8b81d7..b62580461e 100644 --- a/gnu/home/services/xdg.scm +++ b/gnu/home/services/xdg.scm @@ -133,7 +133,12 @@ (define (ensure-xdg-base-dirs-on-activation config) (configuration-field-name field) 'upper)))) ;; XDG_RUNTIME_DIR shouldn't be created during activation ;; and will be provided by elogind or other service. - (and (not (string=? "XDG_RUNTIME_DIR" variable)) + ;; But if the user changes the value from the default, + ;; then we can make XDG_RUNTIME_DIR. + (and (or (not (string=? "XDG_RUNTIME_DIR" variable)) + (not (string=? ((configuration-field-getter field) + config) + "${XDG_RUNTIME_DIR:-/run/user/$UID}"))) variable))) home-xdg-base-directories-configuration-fields))) -- 2.38.1