From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 16 06:58:18 2020 Received: (at 41704-done) by debbugs.gnu.org; 16 Jun 2020 10:58:18 +0000 Received: from localhost ([127.0.0.1]:48366 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jl9IH-0003Ia-Qv for submit@debbugs.gnu.org; Tue, 16 Jun 2020 06:58:18 -0400 Received: from mx1.riseup.net ([198.252.153.129]:49686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jl9IG-0003IS-7j for 41704-done@debbugs.gnu.org; Tue, 16 Jun 2020 06:58:16 -0400 Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 49mQCq3QRWzFcwk; Tue, 16 Jun 2020 03:58:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1592305095; bh=mCZDuCCtO+Zpaqbi9O7XcAHAX3IlMTc0hQWR8JQLSRs=; h=References:From:To:Cc:Subject:In-reply-to:Date:From; b=XqnTWd9QGRxe+mUlYxhaUgorTJT51Cyc5KKLAYfjaXNuKvoKh+DeOI2k4SPjFbPJF QdFG+m6PKDOOxtBzFX7+a4blih4EXuMg0sd5G02gVjZBHjOYVHEV8WW3G24hO306ks KW4sCdvx8xZJy0dsoLbFjCED8nRNO0R8xVl53IgY= X-Riseup-User-ID: BB85D0F4C0C7684037727F936C3E686832DDC76A11B1B3B48A39F6E0F355BC5E Received: from [127.0.0.1] (localhost [127.0.0.1]) by capuchin.riseup.net (Postfix) with ESMTPSA id 49mQCp2vpwz8sgH; Tue, 16 Jun 2020 03:58:14 -0700 (PDT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 80bb0b0e; Tue, 16 Jun 2020 10:58:11 +0000 (UTC) References: <20200604070103.2548-1-pengmeiyu@riseup.net> <20200604090922.19352-1-pengmeiyu@riseup.net> <878sgwoevv.fsf@gnu.org> <87r1ui1337.fsf@pengmeiyu.com> <87bllkoabn.fsf@nckx> From: Peng Mei Yu To: Tobias Geerinckx-Rice Subject: Re: [bug#41704] [PATCH V2] services: nix: Set NIX_CONF_DIR environment variable. Message-ID: <87ftavl1ly.fsf@pengmeiyu.com> In-reply-to: <87bllkoabn.fsf@nckx> Date: Tue, 16 Jun 2020 18:58:11 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 41704-done Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 41704-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi, Tobias Geerinckx-Rice writes: > I agree with Ludo' that fixing this at the package level is more =E2=80= =98appropriate=E2=80=99 > than in the service. I agree too. >> 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 appr= oach. > Override the relevant variables during the install phase without changing= any > run-time settings: > > #+begin_example > 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=3D/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=3D" etc) > + (string-append "profiledir=3D" etc "/profile.d") > + make-flags))))))) > (native-inputs `(("pkg-config" ,pkg-config))) > (inputs `(("boost" ,boost) > ("brotli" ,brotli) > #+end_example > > It installs correctly. I didn't test the service. This is the clean patch I was asking for. The service works well on my computer. Thank you. Please push this patch. -- Peng Mei Yu