unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Tobias Geerinckx-Rice via Guix-patches via <guix-patches@gnu.org>
To: Peng Mei Yu <pengmeiyu@riseup.net>
Cc: "Ludovic Courtès" <ludo@gnu.org>, 41704@debbugs.gnu.org
Subject: [bug#41704] [PATCH V2] services: nix: Set NIX_CONF_DIR environment variable.
Date: Mon, 15 Jun 2020 13:08:44 +0200	[thread overview]
Message-ID: <87bllkoabn.fsf@nckx> (raw)
In-Reply-To: <87r1ui1337.fsf@pengmeiyu.com>

[-- Attachment #1: Type: text/plain, Size: 1758 bytes --]

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
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)))))))
     (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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 227 bytes --]

  reply	other threads:[~2020-06-15 11:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04  7:01 [bug#41704] [PATCH] services: nix: Set NIX_CONF_DIR environment variable Peng Mei Yu
2020-06-04  9:09 ` [bug#41704] [PATCH V2] " Peng Mei Yu
2020-06-09  7:52   ` Ludovic Courtès
2020-06-14  8:10     ` Peng Mei Yu
2020-06-15 11:08       ` Tobias Geerinckx-Rice via Guix-patches via [this message]
2020-06-16 10:58         ` bug#41704: " Peng Mei Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bllkoabn.fsf@nckx \
    --to=guix-patches@gnu.org \
    --cc=41704@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=me@tobias.gr \
    --cc=pengmeiyu@riseup.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).