From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4HaTJMEhfWFVogAAgWs5BA (envelope-from ) for ; Sat, 30 Oct 2021 12:43:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id WPxTIMEhfWFAQgAA1q6Kng (envelope-from ) for ; Sat, 30 Oct 2021 10:43:13 +0000 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 EA22A357DC for ; Sat, 30 Oct 2021 12:43:12 +0200 (CEST) Received: from localhost ([::1]:51514 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mglpP-0000yQ-P0 for larch@yhetil.org; Sat, 30 Oct 2021 06:43:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mglpH-0000u0-3b for guix-patches@gnu.org; Sat, 30 Oct 2021 06:43:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:45185) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mglpG-0001sJ-Rf for guix-patches@gnu.org; Sat, 30 Oct 2021 06:43:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mglpG-0002bI-P7 for guix-patches@gnu.org; Sat, 30 Oct 2021 06:43:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50873] [PATCH v3 2/8] guix home: import: Allow multiple modules to be imported for each service. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 30 Oct 2021 10:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50873 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50873@debbugs.gnu.org, Oleg Pykhalov , Andrew Tropin , Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 50873-submit@debbugs.gnu.org id=B50873.16355905649913 (code B ref 50873); Sat, 30 Oct 2021 10:43:02 +0000 Received: (at 50873) by debbugs.gnu.org; 30 Oct 2021 10:42:44 +0000 Received: from localhost ([127.0.0.1]:56718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgloy-0002Zi-1X for submit@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:44 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:59288 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mglos-0002Ym-Ib for 50873@debbugs.gnu.org; Sat, 30 Oct 2021 06:42:39 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1635590553; bh=bAoSPT5UtBV5uzz4Gu8EWor07tyBeFgdVq/fKmyuhq0=; h=From:To:Subject:In-Reply-To:References:Date; b=pSKso8JClsqDDd5bJeiRBQ01rfwwvmMSwHTsSlzH3xPl/JcXDuWAzSu0c6geWEWFG YaVS+VUwAt8hYfRV8BG2Eo5XROe+x7WFTz0tbu8EjxKZofUgNVn7mrTW6ZnQwmkQ1D vCyYPMXnhVoiw7elf/NlKfiZ01BbzaFoHdS83vl8= In-Reply-To: References: Message-Id: <1002d5577006cc804193f34237415c9707942e27.1635590221.git.public@yoctocell.xyz> Date: Sat, 30 Oct 2021 12:42:32 +0200 MIME-Version: 1.0 Content-Type: text/plain 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635590593; 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:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=vh08E4R/ggKexRx1Yy/d9T6y9PWT1VGYTW4SA8whPnc=; b=NXh8Sbc7YdxFBiAMPiTPKazAcqO8tRtegOJbfvMu9cl839JjKKzOSZrErBUt9elGr1fK+A 1myu6EEKm6tBlduemgoE5GfFrp4PNg1WE++GSUR4oKz2YrDYeuEsjYuDGms5G+KwlYPlGK ni9UwqrD2SyEHKHfKVoDYYp7cSBs8AaZWOSiwmayo8aEUXeWXWJUdkD5+SdqlJD1cBpflv OBBzad4k6vnw9ard4UFosOqF5uoCHI4kSbg2TDC0r3wjrLcvBbLriJm2aapi5pv4tc+bGU YRMYxzB06S5S7iM7r23REKYEXnDPr+cl0pKa2DErYKBDqECIwKVxUzpZXGIaBA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635590593; a=rsa-sha256; cv=none; b=Q5VpwXqEPLzlBn8QNPcLUTmXSd3drb87tLiul9MMz0xDEiWfQe8Kz+rLQv7aE3TLcxf/pV cSSS8FJh+sK/UIwFa6EYLJuPCmnf+I8dVasSMJzMrCKzT43UsWTjpVdpURSIJBnnSnIQFg HJ4k2l6jIZ1SuOQAfu9IqS7o/9kiqLfqRM1+DfZqXDRXTMcnte5Za0gt2rO8iV3z+Ps9Wd WVp6ZTLaq30pskfIUAhvWWIUlWQT9vuVGFnHmGPvWCBUKmNCoeLeaw7yTZ4vhux7i1g8j+ 6hguYVNxsVqoxdlaEnZ+TZqiBdZAITQQac12zGCfVlgm3N/quUeV457EaIsCPg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=pSKso8JC; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 1.18 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=yoctocell.xyz header.s=mail header.b=pSKso8JC; dmarc=fail reason="SPF not aligned (relaxed)" header.from=yoctocell.xyz (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: EA22A357DC X-Spam-Score: 1.18 X-Migadu-Scanner: scn0.migadu.com X-TUID: wMBmkfS9RFz4 Previously, only one module could be imported for each service, e.g., only (gnu home-services shell) could be imported when generating the Bash service declaration. However, for some services, multiple modules might need to be imported in order for it to work. * guix/scripts/home/import.scm (generate-bash-module+configuration): Rename to ... (generate-bash-configuration+modules): ... this. (%files-configurations-alist): Rename to ... (%files+configurations-alist): ... this. (modules+configurations): Rename to ... (configurations+modules): ... this. (manifest->code): Adjust accordingly. --- guix/scripts/home/import.scm | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/guix/scripts/home/import.scm b/guix/scripts/home/import.scm index c7c60e95e8..533abdbb8d 100644 --- a/guix/scripts/home/import.scm +++ b/guix/scripts/home/import.scm @@ -43,8 +43,7 @@ (define (destination-append path) (let ((rc (destination-append ".bashrc")) (profile (destination-append ".bash_profile")) (logout (destination-append ".bash_logout"))) - `((gnu home-services bash) - (service home-bash-service-type + `((service home-bash-service-type (home-bash-configuration ,@(if (file-exists? rc) `((bashrc @@ -60,12 +59,15 @@ (define (destination-append path) `((bash-logout (list (slurp-file-gexp (local-file ,logout))))) - '())))))) + '()))) + (gnu home-services bash)))) -(define %files-configurations-alist - `((".bashrc" . ,generate-bash-module+configuration) - (".bash_profile" . ,generate-bash-module+configuration) - (".bash_logout" . ,generate-bash-module+configuration))) + + +(define %files+configurations-alist + `((".bashrc" . ,generate-bash-configuration+modules) + (".bash_profile" . ,generate-bash-configuration+modules) + (".bash_logout" . ,generate-bash-configuration+modules))) (define (configurations+modules destination-directory) "Return a list of procedures which when called, generate code for a home @@ -144,12 +146,13 @@ (define (qualified-name entry) (let ((configurations+modules (configurations+modules destination-directory))) `(begin - (use-modules (gnu home) - (gnu packages) - ,@(map first modules+configurations)) - ,(home-environment-template - #:specs specs - #:services (map second modules+configurations)))) + (use-modules (gnu home) + (gnu packages) + (gnu services) + ,@(concatenate (map cdr configurations+modules))) + ,(home-environment-template + #:specs specs + #:services (map first configurations+modules)))) `(begin (use-modules (gnu packages)) @@ -190,13 +193,14 @@ (define name (use-modules (guix transformations) (gnu home) (gnu packages) - ,@(map first modules+configurations)) + (gnu services) + ,@(concatenate (map cdr configurations+modules))) ,@transformations ,(home-environment-template #:packages packages - #:services (map second modules+configurations)))) + #:services (map first configurations+modules)))) `(begin (use-modules (guix transformations) (gnu packages)) -- 2.33.0