[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Service customization
From: |
Ludovic Courtès |
Subject: |
Service customization |
Date: |
Wed, 28 Oct 2015 22:33:41 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Hi Guix!
A fairly common pattern in GuixSD is: You want to use whatever is in
‘%desktop-services’, say, but you want to tweak the configuration of
some of the services in there.
This is where the ‘modify-services’ macro comes in, inspired by Taylan’s
‘modify-phases’:
Occasionally, instead of using the base services as is, you will want
to customize them. For instance, to change the configuration of
‘guix-daemon’ and Mingetty (the console log-in), you may write the
following instead of %BASE-SERVICES:
(modify-services %base-services
(guix-service-type config =>
(guix-configuration
(inherit config)
(use-substitutes? #f)
(extra-options '("--gc-keep-outputs"))))
(mingetty-service-type config =>
(mingetty-configuration
(inherit config)
(motd (plain-file "motd" "Hi there!")))))
The effect here is to change the options passed to ‘guix-daemon’ when it
is started, as well as the “message of the day” that appears when
logging in at the console. *Note ‘modify-services’: Service Reference,
for more on that.
Simple but convenient, no?
Ludo’.
- Service customization,
Ludovic Courtès <=