From patchwork Sun Mar 19 15:45:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Trofimov X-Patchwork-Id: 48128 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3302316F18; Sun, 19 Mar 2023 15:46:30 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 34C3416DA3 for ; Sun, 19 Mar 2023 15:46:28 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pdvEW-0003jj-Ih; Sun, 19 Mar 2023 11:46:08 -0400 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 1pdvET-0003jP-6r for guix-patches@gnu.org; Sun, 19 Mar 2023 11:46:05 -0400 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 1pdvER-0001mZ-Ua; Sun, 19 Mar 2023 11:46:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pdvEP-0007RP-P9; Sun, 19 Mar 2023 11:46:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62274] [PATCH] home: 'home-environment-with-provenance' uses the HE location info. Resent-From: Sergey Trofimov Original-Sender: "Debbugs-submit" Resent-CC: paren@disroot.org, andrew@trop.in, ludo@gnu.org, guix-patches@gnu.org Resent-Date: Sun, 19 Mar 2023 15:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62274 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62274@debbugs.gnu.org Cc: Sergey Trofimov , paren@disroot.org, andrew@trop.in, ludo@gnu.org X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: paren@disroot.org, andrew@trop.in, ludo@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167924073928569 (code B ref -1); Sun, 19 Mar 2023 15:46:01 +0000 Received: (at submit) by debbugs.gnu.org; 19 Mar 2023 15:45:39 +0000 Received: from localhost ([127.0.0.1]:52581 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdvE2-0007Qj-Sy for submit@debbugs.gnu.org; Sun, 19 Mar 2023 11:45:39 -0400 Received: from lists.gnu.org ([209.51.188.17]:57784) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pdvE0-0007Qb-Un for submit@debbugs.gnu.org; Sun, 19 Mar 2023 11:45:37 -0400 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 1pdvE0-0003dt-Ik for guix-patches@gnu.org; Sun, 19 Mar 2023 11:45:36 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pdvDy-0001jW-Kq for guix-patches@gnu.org; Sun, 19 Mar 2023 11:45:36 -0400 Received: by mail-ed1-x536.google.com with SMTP id h8so37903676ede.8 for ; Sun, 19 Mar 2023 08:45:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sarg.org.ru; s=google; t=1679240731; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=zPHiimo/bltUndHiAd+CQOUKYKT4DJVBToQHLqTTlr0=; b=GtRlSYQkYnq69iDXo5TA3vHQKTD2LFGQpn7vFGu240EfJUa1bmEi2no2qzLgzBtPjj 22Lo6INmZPRY1JFQA2YoxKFHE+uQXOBZM15N3vwVTvIF6TrrtC0XEZQuYJhoqJWuS+qZ y11JGOmIrNj/TcDtZAizdtXWNxdjmWZDWimvc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679240731; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zPHiimo/bltUndHiAd+CQOUKYKT4DJVBToQHLqTTlr0=; b=1CmZgQfzqe45SQCE3CJkOO1A+mhasrTBmWrqUydyXlmntIoyNfFF4Jjn99I0jHMRMY cJWI66yIgJcqNlqA5Th7uWf641lHldlijRl9Oo9ZQl/ujLcQR27bjj2M/BzZlbstfbkt Dk+oWyBFUpKHRxJeNyPznQCd8Zp++XQE9mg4rodhg5YfAcwGTcl25jFnXTcB/QjSReXJ T7dt48FuzUDvg38VdYPdgA+ShnpMJ5kOaBs1nU4eHVa1yLnuEuH5AHXozESKO21PzGq8 VbHEueyeJnGIlJ2xAPIpVb4x0ULIop2KbUp7vNuNoXTcDECMGpPLkB9LtJuhhQ4lasb/ am5g== X-Gm-Message-State: AO0yUKVr+gxFDaRxnksUC58ntmR1HRNQAsWGSAgYM1gabXtLf5Y8U/hE 9C9gePZ+so3NqwxQ5fKobI2Chf8lWxKPw62TmFg= X-Google-Smtp-Source: AK7set9sF9JlWxThT7dYLgSxnUPBM1vbrb32heRxoKfUIEm0abdF9uPg4IdH6a4HhnRcx4I7Ogvyuw== X-Received: by 2002:aa7:c851:0:b0:500:40f4:f8 with SMTP id g17-20020aa7c851000000b0050040f400f8mr7042386edt.0.1679240730804; Sun, 19 Mar 2023 08:45:30 -0700 (PDT) Received: from localhost ([95.168.147.255]) by smtp.gmail.com with ESMTPSA id u22-20020a50d516000000b004ad601533a3sm3695712edi.55.2023.03.19.08.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Mar 2023 08:45:30 -0700 (PDT) From: Sergey Trofimov Date: Sun, 19 Mar 2023 16:45:37 +0100 Message-Id: <20230319154537.30463-1-sarg@sarg.org.ru> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Received-SPF: none client-ip=2a00:1450:4864:20::536; envelope-from=sarg@sarg.org.ru; helo=mail-ed1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/home.scm (home-environment-with-provenance): Make `config-file` optional, with the default taken from the HE location info. --- gnu/home.scm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/gnu/home.scm b/gnu/home.scm index 6d3f705758..2fefe7ba53 100644 --- a/gnu/home.scm +++ b/gnu/home.scm @@ -103,7 +103,21 @@ (define* (home-environment-derivation he) #:target-type home-service-type))) (service-value home))) -(define* (home-environment-with-provenance he config-file) + +(define (home-environment-configuration-file he) + "Return the configuration file of HE, based on its 'location' field, or #f +if it could not be determined." + (let ((file (and=> (home-environment-location he) + location-file))) + (and file + (or (and (string-prefix? "/" file) file) + (search-path %load-path file))))) + +(define* (home-environment-with-provenance he + #:optional + (config-file + (home-environment-configuration-file + he))) "Return a variant of HE that stores its own provenance information, including CONFIG-FILE, if available. This is achieved by adding an instance of HOME-PROVENANCE-SERVICE-TYPE to its services."