guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#33836] [PATCH 1/2] services: configuration: Add location.


From: Ludovic Courtès
Subject: [bug#33836] [PATCH 1/2] services: configuration: Add location.
Date: Wed, 26 Dec 2018 18:30:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hello,

Oleg Pykhalov <address@hidden> skribis:

> * gnu/services/configuration.scm (define-configuration): Add location.
> * gnu/services/mail.scm (namespace-configuration)[location]: Rename to
> 'mailbox-location'.
> (uglify-field-name): Handle this.
> * doc/guix.texi (Mail Services): Document this.

Nice!

> --- a/gnu/services/configuration.scm
> +++ b/gnu/services/configuration.scm
> @@ -22,6 +22,7 @@
>    #:use-module (guix packages)
>    #:use-module (guix records)
>    #:use-module (guix gexp)
> +  #:use-module ((guix utils) #:select (source-properties->location))
>    #:autoload   (texinfo) (texi-fragment->stexi)
>    #:autoload   (texinfo serialize) (stexi->texi)
>    #:use-module (ice-9 match)
> @@ -129,6 +130,10 @@
>                   #,(id #'stem #'% #'stem)
>                   #,(id #'stem #'make- #'stem)
>                   #,(id #'stem #'stem #'?)
> +                 (location configuration-location
> +                           (default (and=> (current-source-location)
> +                                           source-properties->location))
> +                           (innate))

What about calling the field ‘%location’ instead?  That would avoid the
collision with the other ‘location’ field and it should be fine because
it’s not a field we manually set anyway.

Also, instead of ‘configuration-location’, shouldn’t it be

  (id #'stem #'-location)

?  That will avoid ending up with one ‘configuration-location’ binding
for each record type.

Thanks,
Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]