From mboxrd@z Thu Jan 1 00:00:00 1970 From: Reza Alizadeh Majd Subject: GuixSD Service Implementation Problem Date: Fri, 28 Dec 2018 10:45:42 +0330 Message-ID: <1545981342.3441606.1619766344.1BA0B5B7@webmail.messagingengine.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcmWa-0002mc-D0 for help-guix@gnu.org; Fri, 28 Dec 2018 02:25:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gcmMz-0005Dj-Ng for help-guix@gnu.org; Fri, 28 Dec 2018 02:15:50 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:47665) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gcmMz-0005Bc-DC for help-guix@gnu.org; Fri, 28 Dec 2018 02:15:45 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 7B4E121AC2 for ; Fri, 28 Dec 2018 02:15:43 -0500 (EST) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: help-guix@gnu.org 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 make-foo-configuration foo-configuration? (package foo-configuration-package (default foo-app))) (define foo-shepherd-service (match-lambda (($ 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)))) ```