Subject: Re: [bug#41704] [PATCH V2] services: nix: Set NIX_CONF_DIR environment variable.

From: Peng Mei Yu <[email-masked]>
Date: Sun, 14 Jun 2020 16:10:35 +0800

Hi,

Ludovic Courtès writes:

>> * gnu/services/nix.scm (nix-shepherd-service): Set NIX_CONF_DIR environment
>> variable to "/etc/nix".
>
> Does the (untested) patch below solve the problem for you?
>
> Perhaps it’s more appropriate than setting NIX_CONF_DIR.
>
> Thanks,
> Ludo’.
>
> diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
> index b1c96f18e7..b3c21473ed 100644
> --- a/gnu/packages/package-management.scm
> +++ b/gnu/packages/package-management.scm
> @@ -551,6 +551,7 @@ out) and returning a package that uses that as its 'source'."
>                (base32
>                 "1hbqsrp1ii2sfq8x2mahjrl2182qck76n8blrl1jfz3xq99m6i15"))))
>      (build-system gnu-build-system)
> +    (arguments '(#:configure-flags '("--sysconfdir=/etc")))
>      (native-inputs `(("pkg-config" ,pkg-config)))
>      (inputs `(("boost" ,boost)
>                ("brotli" ,brotli)

No.  I should have mentioned earlier.  With this patch, the install
phase will fail.

#+begin_example
  MKDIR  /etc/profile.d/
  install: cannot change permissions of ‘/etc/profile.d/’: No such file or directory
  make: *** [scripts/local.mk:10: /etc/profile.d/] Error 1
  command "make" "install" failed with status 2
  builder for `/gnu/store/c2lw5faljg1zh5ng4nb0inslq4b0fh9c-nix-2.3.5.drv' failed with exit code 1
  build of /gnu/store/c2lw5faljg1zh5ng4nb0inslq4b0fh9c-nix-2.3.5.drv failed
  View build log at '/var/log/guix/drvs/c2/lw5faljg1zh5ng4nb0inslq4b0fh9c-nix-2.3.5.drv.bz2'.
  guix build: error: build of `/gnu/store/c2lw5faljg1zh5ng4nb0inslq4b0fh9c-nix-2.3.5.drv' failed
#+end_example

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.

--
Peng Mei Yu
https://www.pengmeiyu.com/