From patchwork Mon Jun 15 11:08:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "ashish.is--- via Guix-patches\" via" X-Patchwork-Id: 22719 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 59E0E27BBE1; Mon, 15 Jun 2020 12:09:32 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 9ADBC27BBE3 for ; Mon, 15 Jun 2020 12:09:30 +0100 (BST) Received: from localhost ([::1]:35420 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jkmza-0002Mi-2I for patchwork@mira.cbaines.net; Mon, 15 Jun 2020 07:09:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jkmz8-0002Fm-B3 for guix-patches@gnu.org; Mon, 15 Jun 2020 07:09:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33797) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jkmz8-0004MQ-20 for guix-patches@gnu.org; Mon, 15 Jun 2020 07:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jkmz7-0004t9-Tf for guix-patches@gnu.org; Mon, 15 Jun 2020 07:09:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#41704] [PATCH V2] services: nix: Set NIX_CONF_DIR environment variable. Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 15 Jun 2020 11:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41704 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Peng Mei Yu Cc: Ludovic =?utf-8?q?Court=C3=A8s?= , 41704@debbugs.gnu.org Received: via spool by 41704-submit@debbugs.gnu.org id=B41704.159221933118775 (code B ref 41704); Mon, 15 Jun 2020 11:09:01 +0000 Received: (at 41704) by debbugs.gnu.org; 15 Jun 2020 11:08:51 +0000 Received: from localhost ([127.0.0.1]:45343 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jkmyw-0004sk-O5 for submit@debbugs.gnu.org; Mon, 15 Jun 2020 07:08:51 -0400 Received: from tobias.gr ([80.241.217.52]:53986) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jkmyv-0004sb-Cw for 41704@debbugs.gnu.org; Mon, 15 Jun 2020 07:08:50 -0400 Received: by tobias.gr (OpenSMTPD) with ESMTP id dde742e8; Mon, 15 Jun 2020 11:08:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=tobias.gr; h=from:to:cc :subject:references:in-reply-to:date:message-id:mime-version :content-type; s=2018; i=me@tobias.gr; bh=H3p5URVRcLEZDQklIqjfwi Jowh47hSq2oVYW3qToj7k=; b=d6ow1ROe5okQz/CYoFik8JzqklbC6e8CmV6JbR Vv4a0m8nTuwb0YoMPAB2qj7L3auBatTb3jVhMoUWUI2usTgcv45vgLSMbUBmM+xV LpnS3GL3G34V+fbmx7BAMcDqZYCso6SaY7Zt/7lMKqGg8vIpzXoJgJ45DvlagUmE wDEhchnCVX/cqHraPydqJgPNr/eG3hE7OnECl6q7wvmig5rwkocrTrzYi3dnm2iT vkaEhZpnKNDErEcXtHrls5is6bDzkbo8/koWr6F2v5uymYfiM9uPsD3juJGRwhob miWgyvpY1/ZDp9foS1Ky19nwIbyTaPP0FLBmQ36bHvQf0EAg== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id cf5593b5 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Mon, 15 Jun 2020 11:08:57 +0000 (UTC) BIMI-Selector: v=BIMI1; s=default; References: <20200604070103.2548-1-pengmeiyu@riseup.net> <20200604090922.19352-1-pengmeiyu@riseup.net> <878sgwoevv.fsf@gnu.org> <87r1ui1337.fsf@pengmeiyu.com> In-reply-to: <87r1ui1337.fsf@pengmeiyu.com> Date: Mon, 15 Jun 2020 13:08:44 +0200 Message-ID: <87bllkoabn.fsf@nckx> MIME-Version: 1.0 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" Reply-to: Tobias Geerinckx-Rice , Tobias Geerinckx-Rice via Guix-patches X-Patchwork-Original-From: Tobias Geerinckx-Rice via Guix-patches via From: "ashish.is--- via Guix-patches\" via" X-getmail-retrieved-from-mailbox: Patches Hi Peng Mei Yu, I agree with Ludo' that fixing this at the package level is more ‘appropriate’ than in the service. Peng Mei Yu 写道: > There is no obvious way to fix the error, so setting > NIX_CONF_DIR is > easier. Perhaps someone can fix the nix package with a clean > patch. > That would be better. Obvious is different things to different people, but here's my go-to approach. Override the relevant variables during the install phase without changing any run-time settings: #+begin_example (native-inputs `(("pkg-config" ,pkg-config))) (inputs `(("boost" ,boost) ("brotli" ,brotli) #+end_example It installs correctly. I didn't test the service. Kind regards, T G-R diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm index c1e6657dff..fefa17a162 100644 --- a/gnu/packages/package-management.scm +++ b/gnu/packages/package-management.scm @@ -551,6 +551,19 @@ out) and returning a package that uses that as its 'source'." (base32 "1hbqsrp1ii2sfq8x2mahjrl2182qck76n8blrl1jfz3xq99m6i15")))) (build-system gnu-build-system) + (arguments + `(#:configure-flags + (list "--sysconfdir=/etc") + #:phases + (modify-phases %standard-phases + (replace 'install + (lambda* (#:key (make-flags '()) outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (etc (string-append out "/etc"))) + (apply invoke "make" "install" + (string-append "sysconfdir=" etc) + (string-append "profiledir=" etc "/profile.d") + make-flags)))))))