all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Julien Lepiller <julien@lepiller.eu>
To: help-guix@gnu.org, Giovanni Biscuolo <g@xelera.eu>
Subject: Re: how to split config.scm in multiple files
Date: Sat, 17 Nov 2018 10:16:53 +0100	[thread overview]
Message-ID: <3BBFCEAE-542D-4FA0-BF7D-EF6DA2A793F6@lepiller.eu> (raw)
In-Reply-To: <87va4w13mx.fsf@roquette.mug.biscuolo.net>

Hi,

You can create a module, say /etc/config/base-services.scm

To include it, you need to make it a module, so in base-services.scm:

(define-module (base-services)
  #:use-module (gnu services base)
  …
  #:export (my-services))
(define my-services (cons*.… %base-services))

And in your config.scm, you can import this module like so:

(add-to-load-path "/etc/config")
(use-modules (base-services))

(operating-system
  …
  (services my-services))

I don't think you can include a scheme file in the operating-system record directly, but maybe someone will prove me wrong :)

Le 17 novembre 2018 09:59:02 GMT+01:00, Giovanni Biscuolo <g@xelera.eu> a écrit :
>Hello Help! :-)
>
>sorry but I'm new to Guile
>
>please is there a way to include external .scm files in my main
>config.scm, I tried with Guile local inclusion in config.scm
>
> (include base-services.scm)
>
>but I get
>
>.................
>sudo guix system reconfigure config.scm
>config.scm:8:0: error: extraneous field initializers (include)
>................
>
>thanks!
>Giovanni

  reply	other threads:[~2018-11-17  9:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-17  8:59 how to split config.scm in multiple files Giovanni Biscuolo
2018-11-17  9:16 ` Julien Lepiller [this message]
2018-11-22 13:04 ` Ludovic Courtès
2018-11-27 17:57   ` Giovanni Biscuolo
2018-11-28 17:11     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3BBFCEAE-542D-4FA0-BF7D-EF6DA2A793F6@lepiller.eu \
    --to=julien@lepiller.eu \
    --cc=g@xelera.eu \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.