From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4EOAM7Fm3mIYFgEAbAwnHQ (envelope-from ) for ; Mon, 25 Jul 2022 11:47:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id yJSIM7Fm3mI7lgAA9RJhRA (envelope-from ) for ; Mon, 25 Jul 2022 11:47:29 +0200 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 553493DEA for ; Mon, 25 Jul 2022 11:47:29 +0200 (CEST) Received: from localhost ([::1]:60168 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oFugS-0003Qr-9F for larch@yhetil.org; Mon, 25 Jul 2022 05:47:28 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46152) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFug3-0003Qh-BS for guix-patches@gnu.org; Mon, 25 Jul 2022 05:47:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59541) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oFug2-0005wP-KS for guix-patches@gnu.org; Mon, 25 Jul 2022 05:47:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oFug2-0004zk-DG for guix-patches@gnu.org; Mon, 25 Jul 2022 05:47:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56758] [PATCH 0/2] Don't try to mkdir XDG_RUNTIME_DIR Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 25 Jul 2022 09:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56758 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56758@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.165874240119169 (code B ref -1); Mon, 25 Jul 2022 09:47:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Jul 2022 09:46:41 +0000 Received: from localhost ([127.0.0.1]:49290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oFufg-0004z7-G7 for submit@debbugs.gnu.org; Mon, 25 Jul 2022 05:46:40 -0400 Received: from lists.gnu.org ([209.51.188.17]:47386) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oFufe-0004yz-P8 for submit@debbugs.gnu.org; Mon, 25 Jul 2022 05:46:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFufe-0003Js-Ft for guix-patches@gnu.org; Mon, 25 Jul 2022 05:46:38 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:41319) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oFufa-0005o4-Kr for guix-patches@gnu.org; Mon, 25 Jul 2022 05:46:37 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id 49ABB24000B for ; Mon, 25 Jul 2022 09:46:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1658742390; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=nmKVQe2/RYUl9zZkz2ZghI3w0uMMed4qVNjT9n61JNg=; b=b8BkpYn4xZENLbQaibJ7UeE2tgSLcasF0wpPb8c5EzXvckj9uzfqbyfNOcVYrxUaUXg6in HMkD2yNrocUSj9+AmJt+jaHWg9biCInuO/h0LiGkddx2gScaSOZjjRIayjyLJa9GhKiRcc hZaPllozWgNw6csGTlkJKpGA0HoOl5PV+jajHPW6nQrAe5B5HNpedtsGQ+hhDOhTTMsa5d azy3Qhm253wekosqscOZUYYN4sV0CcxSp+4/ADFePKlMVxpMWHFkdUDh2GGu3zk6ans1KT lnNCTvEb2p/EBTcbmXk0IwWwVY+ZSl5Evn3Vo6FMszvmrPP1Vj32kHGfdPXxbQ== From: Andrew Tropin Date: Mon, 25 Jul 2022 12:43:47 +0300 Message-ID: <87wnc1zfrh.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=217.70.178.230; envelope-from=andrew@trop.in; helo=relay10.mail.gandi.net 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, T_SCC_BODY_TEXT_LINE=-0.01 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1658742449; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=nmKVQe2/RYUl9zZkz2ZghI3w0uMMed4qVNjT9n61JNg=; b=YUZFnGEKz+0Ro2gadeBPYpEqHsLk7cIwKPwkly3vLLflzsl+qDbU9DkeI9nQjDll2licJl cjwFng5tRZFRYHTkBaQr7THJVRg9md+9WW71i3CQepY4JaqExSjl9jwilcgA2rvfncCBlV I2LcinnzW1KHzS1cM9W3LZ4EJdfMKP+NQQJHwpmIsLi/AyoF1yhRO9snqBOw7UYYgdUAga fCnW/A+88vRo4Y4suI1awKLap3xDGrBh1w7pGgkMyQ/Stb4aON+f2L/h1nbngV1gOgpobG rCyqDrpJ0GFcrDYejL8XFqSDJoH+u4A1+MOo7jNoO9JLuPO4mJZ3U6ZDn0rL2A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1658742449; a=rsa-sha256; cv=none; b=NjZcd3uqkfxxykzz6KemdgaRk3hqF8EHKOuJW+0i7I1gBnnGg+zo9AOyc0pn8ktf0dhrrg 5NddOeA9nvaGKKHWYLmtr8ad6zSQW1ud2ZJUQqEkkZg5rCht2lN+dKDU4ub424AMgN0dnQ umm3/3oCBQMf5OK2HGTAnDC2h0a+LaIoDxcwwfC+i0bb6ezQlyvWGD35zG1IBCSUldxjgH xhuUAZqtM2Yu1uXAeDkK9MmRS+Zm3zzKwm0tOuKvqF/sPFjomc+TZ1rPxC7s5tC3+1OQwt SKZceuddFZ45DUS72Za8nkXMnNw6eCzzy+FmJrUrH0cVxO0Q/J91R4R1XsKYIw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=b8BkpYn4; dmarc=none; 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" X-Migadu-Spam-Score: -0.53 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop.in header.s=gm1 header.b=b8BkpYn4; dmarc=none; 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" X-Migadu-Queue-Id: 553493DEA X-Spam-Score: -0.53 X-Migadu-Scanner: scn0.migadu.com X-TUID: ShZRds4BNQ6x --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Andrew Tropin (2): home: xdg: Use closures in activation scripts. home: xdg: Skip mkdir XDG_RUNTIME_DIR in activation script. gnu/home/services/xdg.scm | 46 ++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 18 deletions(-) =2D-=20 2.37.0 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-home-xdg-Use-closures-in-activation-scripts.patch Content-Transfer-Encoding: quoted-printable From=20d08ed8de3ead1a704a96e0e6673dffb62f859597 Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Thu, 21 Jul 2022 15:24:32 +0300 Subject: [PATCH 1/2] home: xdg: Use closures in activation scripts. * gnu/home/services/xdg.scm (ensure-xdg-base-dirs-on-activation, home-xdg-user-directories-files-service): Use closures in activation script= s. =2D-- gnu/home/services/xdg.scm | 41 ++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm index 71c028c788..5a41dc4994 100644 =2D-- a/gnu/home/services/xdg.scm +++ b/gnu/home/services/xdg.scm @@ -23,6 +23,7 @@ (define-module (gnu home services xdg) #:use-module (gnu packages freedesktop) #:use-module (gnu home services utils) #:use-module (guix gexp) + #:use-module (guix modules) #:use-module (guix records) #:use-module (guix i18n) #:use-module (guix diagnostics) @@ -105,16 +106,17 @@ (define (home-xdg-base-directories-environment-variab= les-service config) home-xdg-base-directories-configuration-fields)) =20 (define (ensure-xdg-base-dirs-on-activation config) =2D #~(map (lambda (xdg-base-dir-variable) =2D ((@@ (guix build utils) mkdir-p) =2D (getenv =2D xdg-base-dir-variable))) =2D '#$(map (lambda (field) =2D (format =2D #f "XDG_~a" =2D (object->snake-case-string =2D (configuration-field-name field) 'upper))) =2D home-xdg-base-directories-configuration-fields))) + (with-imported-modules '((guix build utils)) + #~(map (lambda (xdg-base-dir-variable) + ((@ (guix build utils) mkdir-p) + (getenv + xdg-base-dir-variable))) + '#$(map (lambda (field) + (format + #f "XDG_~a" + (object->snake-case-string + (configuration-field-name field) 'upper))) + home-xdg-base-directories-configuration-fields)))) =20 (define (last-extension-or-cfg config extensions) "Picks configuration value from last provided extension. If there @@ -205,14 +207,17 @@ (define (home-xdg-user-directories-activation-service= config) (let ((dirs (map (lambda (field) ((configuration-field-getter field) config)) home-xdg-user-directories-configuration-fields))) =2D #~(let ((ensure-dir =2D (lambda (path) =2D (mkdir-p =2D ((@@ (ice-9 string-fun) string-replace-substring) =2D path "$HOME" (getenv "HOME")))))) =2D (display "Creating XDG user directories...") =2D (map ensure-dir '#$dirs) =2D (display " done\n")))) + (with-imported-modules `((guix build utils) + ,@(source-module-closure + '((ice-9 string-fun)))) + #~(let ((ensure-dir + (lambda (path) + ((@ (guix build utils) mkdir-p) + ((@ (ice-9 string-fun) string-replace-substring) + path "$HOME" (getenv "HOME")))))) + (display "Creating XDG user directories...") + (map ensure-dir '#$dirs) + (display " done\n"))))) =20 (define home-xdg-user-directories-service-type (service-type (name 'home-xdg-user-directories) =2D-=20 2.37.0 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-home-xdg-Skip-mkdir-XDG_RUNTIME_DIR-in-activation-sc.patch Content-Transfer-Encoding: quoted-printable From=20da332f8272ea3c240fc4e3664051da3b3a4e18c6 Mon Sep 17 00:00:00 2001 From: Andrew Tropin Date: Thu, 21 Jul 2022 17:06:24 +0300 Subject: [PATCH 2/2] home: xdg: Skip mkdir XDG_RUNTIME_DIR in activation script. * gnu/home/services/xdg.scm (ensure-xdg-base-dirs-on-activation): Skip mkdir XDG_RUNTIME_DIR in activation script. =2D-- gnu/home/services/xdg.scm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/gnu/home/services/xdg.scm b/gnu/home/services/xdg.scm index 5a41dc4994..541f64a379 100644 =2D-- a/gnu/home/services/xdg.scm +++ b/gnu/home/services/xdg.scm @@ -109,13 +109,18 @@ (define (ensure-xdg-base-dirs-on-activation config) (with-imported-modules '((guix build utils)) #~(map (lambda (xdg-base-dir-variable) ((@ (guix build utils) mkdir-p) =2D (getenv =2D xdg-base-dir-variable))) =2D '#$(map (lambda (field) =2D (format =2D #f "XDG_~a" =2D (object->snake-case-string =2D (configuration-field-name field) 'upper))) + (getenv xdg-base-dir-variable))) + '#$(filter-map + (lambda (field) + (let ((env-var-name + (format + #f "XDG_~a" + (object->snake-case-string + (configuration-field-name field) 'upper)))) + ;; XDG_RUNTIME_DIR shouldn't be created during activati= on + ;; and will be provided by elogind or other service. + (and (not (string=3D? "XDG_RUNTIME_DIR" env-var-name)) + env-var-name))) home-xdg-base-directories-configuration-fields)))) =20 (define (last-extension-or-cfg config extensions) =2D-=20 2.37.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmLeZnIACgkQIgjSCVjB 3rDgOA//YAHIzdu//xKHVLh/qsavFcj1Zl/mI8KJAr4o4+oCrWR4UwVC9pf5Zx5Z eUcU36I0qs7MwuVa3LlrrCWtuDxi3twpLs1V94FyloP0X8p5og1loX91BF4iM9Wh 3xwgrMWzsHWZ3crl1VlkhsoastPXGZss85ZJQJzZgc+YuG+s+n6M/M/bL+Qq5ZXM mAUMB7w6PKcp0x1K8dOHfjDVqLcA/Z67qgdZBD2CXh9icZ2n1RcV+0WpOSPAN6Wn krJfsOOvlr0Kgw5jmA6Hu4ljLoLxmLNnhDgr0yA5hnDW1i3U5wx0oa/rT4I8mWAj jQd7J1XRo5WpZg+nI7S4+bsCL2from3AButKTF/UI79fu5b7Ru1Fr8Mt19Mr9Dgj M5L3QatXMNZI9e1uTXxGeZPqaHh0VYk9BWFolA+lRCgoRGV7VzOfotpg2YioBs7R 96F0srzreWWWnOeHwTTb8L8L2S/3BANhm+9cWKzTxcx99KHOAIlYiacvdIEjKqDE y0l1kLo5mSD88jWTFH+w7Auy8kQk8ZbuNzHhe9gTkfhKVwyiUAuG3/yDAo0b2T9M VCCF6n8vLD2CjEc4OOt1AUUgHbDuSeNSJbNaUEy3D4iqsZiIPu0YnER6c9lHFEiP Q8qHJjkTBxTSxpXIq+nHh9pj6B+Yf1SWg91cNhKst42pb26x/M8= =tjzv -----END PGP SIGNATURE----- --==-=-=--