aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/guix.texi6
-rw-r--r--gnu/services/nfs.scm25
2 files changed, 16 insertions, 15 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index af87d76087..8cb85fe62c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -22233,9 +22233,9 @@ It has the following parameters:
@item @code{nfs-utils} (default: @code{nfs-utils})
The nfs-utils package to use.
-@item @code{nfs-version} (default: @code{#f})
-If a string value is provided, the @command{rpc.nfsd} daemon will be
-limited to supporting the given version of the NFS protocol.
+@item @code{nfs-versions} (default: @code{'("4.2" "4.1" "4.0")})
+If a list of string values is provided, the @command{rpc.nfsd} daemon
+will be limited to supporting the given versions of the NFS protocol.
@item @code{exports} (default: @code{'()})
This is a list of directories the NFS server should export. Each entry
diff --git a/gnu/services/nfs.scm b/gnu/services/nfs.scm
index cbaa97b2fd..4e358197e2 100644
--- a/gnu/services/nfs.scm
+++ b/gnu/services/nfs.scm
@@ -245,8 +245,8 @@
nfs-configuration?
(nfs-utils nfs-configuration-nfs-utils
(default nfs-utils))
- (nfs-version nfs-configuration-nfs-version
- (default #f)) ; string
+ (nfs-versions nfs-configuration-nfs-versions
+ (default '("4.2" "4.1" "4.0")))
(exports nfs-configuration-exports
(default '()))
(rpcmountd-port nfs-configuration-rpcmountd-port
@@ -270,7 +270,7 @@
(define (nfs-shepherd-services config)
"Return a list of <shepherd-service> for the NFS daemons with CONFIG."
(match-record config <nfs-configuration>
- (nfs-utils nfs-version exports
+ (nfs-utils nfs-versions exports
rpcmountd-port rpcstatd-port nfsd-port nfsd-threads
pipefs-directory debug)
(list (shepherd-service
@@ -323,15 +323,16 @@
(requirement '(/proc/fs/nfsd rpc.statd networking))
(start
#~(lambda _
- (zero? (system* #$(file-append nfs-utils "/sbin/rpc.nfsd")
- #$@(if (member 'nfsd debug)
- '("--debug")
- '())
- "--port" #$(number->string nfsd-port)
- #$@(if nfs-version
- '("--nfs-version" nfs-version)
- '())
- #$(number->string nfsd-threads)))))
+ (zero? (apply system* #$(file-append nfs-utils "/sbin/rpc.nfsd")
+ (list
+ #$@(if (member 'nfsd debug)
+ '("--debug")
+ '())
+ "--port" #$(number->string nfsd-port)
+ #$@(map (lambda (version)
+ (string-append "--nfs-version=" version))
+ nfs-versions)
+ #$(number->string nfsd-threads))))))
(stop
#~(lambda _
(zero?