[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Service customization
From: |
Alex Kost |
Subject: |
Re: Service customization |
Date: |
Thu, 29 Oct 2015 23:11:50 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Ludovic Courtès (2015-10-29 00:33 +0300) wrote:
> 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?
This is awesome! Thank you!!
--
Alex