John Darrington <j...@gnu.org> skribis: > * gnu/services/nfs: New file. ^^ > * gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
For the final patch, please make sure to mention it in guix.texi. > --- /dev/null > +++ b/gnu/services/nfs.scm Missing license. > @@ -0,0 +1,25 @@ > +(define-module (gnu services nfs) > + #:use-module (gnu) > + #:use-module (gnu services shepherd) > + #:use-module (gnu packages onc-rpc) > + #:use-module (guix) > + #:export (rpc-service)) > + > +(define (rpc-shepherd-service config) ; Config is ignored > + (list (shepherd-service > + (provision '(rpc-daemon)) > + (requirement '(networking)) > + (start #~(make-forkexec-constructor > + (list (string-append #$rpcbind "/bin/rpcbind") "-d" > "-f"))) > + (stop #~(make-kill-destructor))))) > + > +(define rpc-service-type > + (service-type > + (name 'rpc) > + (extensions (list (service-extension shepherd-root-service-type > + rpc-shepherd-service))))) In this case, you can simply write: (define rpcbind-service-type (shepherd-service-type 'rpcbind (lambda (config) (shepherd-service …)))) I think the service should be called “rpcbind”, and not “rpc” (there are other ONC RPC and NFS daemons, such as mountd and statd, so we need to use clear names.) > +(define* (rpc-service config) > + "Run the rpc daemon. Config is ignored." > + (service rpc-service-type config)) There’s at least one bit of config needed: the ‘rpcbind’ package to use. So I would write it as: (service rpcbind-service-type rpcbind) and then honor this argument. Also, the preferred way now is to expose service-type objects and not provide procedures like the one above. So you can omit this procedure and instead make sure to #:export (rpcbind-service-type). Could you send an updated patch? If you’re willing to play a bit, it would be nice to have a system test that spawns a GuixSD with this service, and then makes sure that, say, the ‘rpcinfo’ program is able to connect to the daemon. But that’s bonus. :-) Thanks! Ludo’.