guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/04: services: nix: Add extra-options.


From: guix-commits
Subject: 04/04: services: nix: Add extra-options.
Date: Sat, 25 Jul 2020 05:28:51 -0400 (EDT)

wigust pushed a commit to branch master
in repository guix.

commit 64c6282e7fc69ff58e7257a7e72284f63f2f5956
Author: Oleg Pykhalov <go.wigust@gmail.com>
AuthorDate: Sat Jul 25 11:51:49 2020 +0300

    services: nix: Add extra-options.
    
    * gnu/services/nix.scm (<nix-configuration>)[extra-options]: New field.
    (nix-shepherd-service): Add this.
    (nix-activation): Add new line to the end of /etc/nix/nix.conf file.
    * doc/guix.texi (Miscellaneous Services)[Nix service]: Document this.
---
 doc/guix.texi        |  3 +++
 gnu/services/nix.scm | 10 +++++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index a6fc64b..e2b304f 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -27637,6 +27637,9 @@ This is a list of strings or objects appended to the
 This is a list of strings or objects appended to the configuration file.
 It is used to pass extra text to be added verbatim to the configuration
 file.
+
+@item @code{extra-options} (default: @code{'()})
+Extra command line options for @code{nix-service-type}.
 @end table
 @end deftp
 
diff --git a/gnu/services/nix.scm b/gnu/services/nix.scm
index ba94cfa..93f46ef 100644
--- a/gnu/services/nix.scm
+++ b/gnu/services/nix.scm
@@ -56,6 +56,8 @@
   (build-sandbox-items nix-configuration-build-sandbox-items ;list of strings
                        (default '()))
   (extra-config        nix-configuration-extra-config ;list of strings
+                       (default '()))
+  (extra-options       nix-configuration-extra-options ;list of strings
                        (default '())))
 
 ;; Copied from gnu/services/base.scm
@@ -116,19 +118,21 @@ GID."
                                            '#$(map references-file
                                                    (list package)))
                                '#$build-sandbox-items))
-               (for-each (cut display <>) '#$extra-config))))))))
+               (for-each (cut display <>) '#$extra-config)
+               (newline))))))))
 
 (define nix-shepherd-service
   ;; Return a <shepherd-service> for Nix.
   (match-lambda
-    (($ <nix-configuration> package _ ...)
+    (($ <nix-configuration> package _ _ _ extra-options)
      (list
       (shepherd-service
        (provision '(nix-daemon))
        (documentation "Run nix-daemon.")
        (requirement '())
        (start #~(make-forkexec-constructor
-                 (list (string-append #$package "/bin/nix-daemon"))))
+                 (list (string-append #$package "/bin/nix-daemon")
+                       #$@extra-options)))
        (respawn? #f)
        (stop #~(make-kill-destructor)))))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]