unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* GuixSD Service Implementation Problem
@ 2018-12-28  7:15 Reza Alizadeh Majd
  0 siblings, 0 replies; only message in thread
From: Reza Alizadeh Majd @ 2018-12-28  7:15 UTC (permalink / raw)
  To: help-guix

Hi, 

I'm working on an application which should be run as a service on GuixSD. 
I followed other service definitions and add my service definition file inside 
`GUIX_PACKAGE_PATH` path. but when I add this service to my system 
configuration file, and perform `guix system reconfigure /etc/config.scm`, 
receive following Error: 

```
ice-9/eval.scm:142:16: In procedure compile-top-call:
error: foo-service: unbound variable
hint: Did you forget `(use-modules (px services foo))'?
```

could anyone help me on this issue?


my system configuration file: 

```
(use-modules (gnu)
             (px services foo))
...

(operating-system
  ...
  
  (services (cons* 
               (foo-service)
	           (dhcp-client-service)
	           ...
               %base-services))

  (name-service-switch %mdns-host-lookup-nss))
  ```
  
my service definition:
	
```
(define-module (px services foo)
	       #:use-module (gnu services)
	       #:use-module (gnu services shepherd)
	       #:use-module (px packages foo)
	       #:use-module (guix qexp)
	       #:use-module (guix records)
	       #:use-module (ice-9 match)
	       #:export (foo-service))

(define-record-type* <foo-configuration>
		     foo-configuration  make-foo-configuration
		     foo-configuration?
		     (package foo-configuration-package
			      (default foo-app)))

(define foo-shepherd-service
  (match-lambda
    (($ <foo-configuration> package)
     (list (shepherd-service
	     (provision '(foo-service))
	     (documentation "foo service")
	     (requirement '(user-processes))
	     (start #~((make-forkexec-constructor
			 (list
			   (string-append #$package "/bin/foo_app")))))
	     (stop #~((make-kill-destructor))))))))


(define foo-service-type
  (service-type (name 'fooservice)
		(extensions
		  (list (service-extensions shepherd-root-service-type
					    foo-shepherd-service)))))

(define* (foo-service #:key (package foo-app))
	 "Foo Service"
	 (service foo-service-type
		  (foo-configuration
		    (package package))))
```
  

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-12-28  7:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-28  7:15 GuixSD Service Implementation Problem Reza Alizadeh Majd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).