Subject: [bug#42489] [PATCH] services: nix: Provide nix commands.

From: Oleg Pykhalov <[email-masked]>
Date: Fri, 24 Jul 2020 18:06:00 +0300

Hi,

Peng Mei Yu <[email-masked]> writes:

> * gnu/services/nix.scm (nix-service-type): Extend profile-service-type to
> provide nix commands.
> ---
>  gnu/services/nix.scm | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/services/nix.scm b/gnu/services/nix.scm
> index 75b2df02dc..e73203c2c5 100644
> --- a/gnu/services/nix.scm
> +++ b/gnu/services/nix.scm
> @@ -1,5 +1,6 @@
>  ;;; GNU Guix --- Functional package management for GNU
>  ;;; Copyright © 2019, 2020 Oleg Pykhalov <[email-masked]>
> +;;; Copyright © 2020 Peng Mei Yu <[email-masked]>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -134,7 +135,9 @@ GID."
>     (extensions
>      (list (service-extension shepherd-root-service-type nix-shepherd-service)
>            (service-extension account-service-type nix-accounts)
> -          (service-extension activation-service-type nix-activation)))
> +          (service-extension activation-service-type nix-activation)
> +          (service-extension profile-service-type
> +                             (compose list nix-configuration-package))))
>     (description "Run the Nix daemon.")
>     (default-value (nix-configuration))))

I don't understand what you trying to archive. 

Do you want to run `/gnu/store/…nix…/bin/nix-daemon` with flags, like
‘--debug’?  It's better to add ‘extra-options’ to ‘<nix-configuration>’
record and use it in ‘nix-shepherd-service’.

Also, I found a typo in ‘<nix-configuration>’
‘nix-configuration-extra-options’ should be
‘nix-configuration-extra-config’.

Could you documentat the feature in ‘doc/guix.texi’, please?

> * gnu/services/nix.scm (nix-configuration): Export it.
                                                     ^^^
Just “Export.”.

> ---
>  gnu/services/nix.scm | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/services/nix.scm b/gnu/services/nix.scm
> index e73203c2c5..5a0a965a69 100644
> --- a/gnu/services/nix.scm
> +++ b/gnu/services/nix.scm
> @@ -35,7 +35,8 @@
>    #:use-module (ice-9 match)
>    #:use-module (ice-9 format)
>    #:use-module (guix modules)
> -  #:export (nix-service-type))
> +  #:export (nix-configuration
> +            nix-service-type))

OK, but also export ‘nix-configuration?’.

Thanks,
Oleg.