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 ms9.migadu.com with LMTPS id QHQ7GlQuF2T4qwAASxT56A (envelope-from ) for ; Sun, 19 Mar 2023 16:46:28 +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 UEI1GlQuF2SXZwEA9RJhRA (envelope-from ) for ; Sun, 19 Mar 2023 16:46:28 +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 451BA2B178 for ; Sun, 19 Mar 2023 16:46:28 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=sarg.org.ru header.s=google header.b=GtRlSYQk; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679240788; h=from:from:sender:sender: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=zPHiimo/bltUndHiAd+CQOUKYKT4DJVBToQHLqTTlr0=; b=Iqe2TOaq1JHOg4dTWKnrzmB7ejuH9jYf3NqAv67lTsgZMGIt3JKroBbih5wPNQvY/zmoih XZzx3w2fZViXbSeNiq+VuCXvXWDPm+TVoTvisB5ACu/joWo2lGy/IxlApmRqKAvtn0spTh 1/BYcoCBvTetpSco+D1TwJFn+RsHVH0y8NxM9is76I6+8axLyoVyWJ7I+zfyC7VM/FuGIZ 2vh4bWQDSnf63BkGuGIBS8Ax6WF8cgdsDTlH9V2BSq8WQ4vwPY0bLPnSkCUXcAbiurA+Zn Pm5OSlZ9lo5Nlf9rnBc9j2jzf1N3Ss4TpsQC2+5kKYcsFk4g3O6suoEnC5K+tg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=sarg.org.ru header.s=google header.b=GtRlSYQk; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679240788; a=rsa-sha256; cv=none; b=arsVE94jnkTEpe252F3vGUXrWlEoPsIHQCI691pUQVuMGJ6BeWUnfqANUglB2wDFX6UxEC l9qIIF3NpCHjEUUddqzIesR8DxiEaOu0mc6fYCqJye/uJhtJ66b2DCtHoE0CIhnEsNCye1 8QfFdSNtWOVYlBpPfy7zaXsm9yKgt/Vw/bgIVmO32rC016qlXPHjZIkR85tYEYjLLwCRGy M57eOR92ffyXBvG/XigyLhDs9AxahpFfyE9QlwLrzHT/jyjmZruG6Xvv5N8J3qUKnb2ld7 hedhVPmqYeNlc9Kgp1iwtMJe14BI6yHlSM2JAySQbO9D1r2UQ0q9DpXxT3Ekbw== 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 Content-Transfer-Encoding: 8bit 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: X-Migadu-Queue-Id: 451BA2B178 X-Spam-Score: -0.85 X-Migadu-Spam-Score: -0.85 X-Migadu-Scanner: scn0.migadu.com List-Help: List-Subscribe: , 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 X-TUID: p93SBZqxNhB6 * 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." -- 2.39.2