all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#49288] [PATCH] gnu: services: Export provenance-entry and sexp->channel
@ 2021-06-30  9:45 Andrew Tropin
  2021-07-01 13:37 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Tropin @ 2021-06-30  9:45 UTC (permalink / raw)
  To: 49288

These functions are need for Guix Home.
---
 For now functions are copy pasted, but it seems better to reuse
 existing functions.
 https://git.sr.ht/~abcdw/rde/tree/057888b2604b05d555fd1b67f3d356644f9a134d/gnu/home-services.scm#L418
 
 gnu/services.scm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gnu/services.scm b/gnu/services.scm
index 8d413e198e..53b358c63b 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -91,6 +91,9 @@
             ambiguous-target-service-error-service
             ambiguous-target-service-error-target-type
 
+            provenance-entry
+            sexp->channel
+
             system-service-type
             provenance-service-type
             sexp->system-provenance
-- 
2.32.0


<#secure method=pgpmime mode=sign>




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#49288] [PATCH] gnu: services: Export provenance-entry and sexp->channel
  2021-06-30  9:45 [bug#49288] [PATCH] gnu: services: Export provenance-entry and sexp->channel Andrew Tropin
@ 2021-07-01 13:37 ` Ludovic Courtès
  2021-07-01 14:36   ` Andrew Tropin
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2021-07-01 13:37 UTC (permalink / raw)
  To: Andrew Tropin; +Cc: 49288

Hi!

Andrew Tropin <andrew@trop.in> skribis:

> These functions are need for Guix Home.
> ---
>  For now functions are copy pasted, but it seems better to reuse
>  existing functions.
>  https://git.sr.ht/~abcdw/rde/tree/057888b2604b05d555fd1b67f3d356644f9a134d/gnu/home-services.scm#L418
>  
>  gnu/services.scm | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/gnu/services.scm b/gnu/services.scm
> index 8d413e198e..53b358c63b 100644
> --- a/gnu/services.scm
> +++ b/gnu/services.scm
> @@ -91,6 +91,9 @@
>              ambiguous-target-service-error-service
>              ambiguous-target-service-error-target-type
>  
> +            provenance-entry
> +            sexp->channel

This ‘sexp->channel’ exists “for historical reasons”.  Could you use
(@ (guix channels) sexp->channel) instead, together with
‘channel-instance->sexp’?

Actually, could you define it like so:

--8<---------------cut here---------------start------------->8---
(define home-provenance-service-type
  (service-type
   (inherit provenance-service-type)
   (extensions
    (list (service-extension
	   home-service-type
           (service-extension-compute
	    (first (service-extensions provenance-service-type))))))
   (default-value #f)))
--8<---------------cut here---------------end--------------->8---

More generally, perhaps you could have a procedure that takes a service
type and “rewires” it so that it extends ‘home-service-type’ instead of
‘etc-service-type’, say.  Does that make sense?

Ludo’.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [bug#49288] [PATCH] gnu: services: Export provenance-entry and sexp->channel
  2021-07-01 13:37 ` Ludovic Courtès
@ 2021-07-01 14:36   ` Andrew Tropin
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Tropin @ 2021-07-01 14:36 UTC (permalink / raw)
  To: Ludovic Courtès, 49288-done; +Cc: 49288

[-- Attachment #1: Type: text/plain, Size: 1764 bytes --]

Ludovic Courtès <ludo@gnu.org> writes:

> Hi!
>
> Andrew Tropin <andrew@trop.in> skribis:
>
>> These functions are need for Guix Home.
>> ---
>>  For now functions are copy pasted, but it seems better to reuse
>>  existing functions.
>>  https://git.sr.ht/~abcdw/rde/tree/057888b2604b05d555fd1b67f3d356644f9a134d/gnu/home-services.scm#L418
>>  
>>  gnu/services.scm | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/gnu/services.scm b/gnu/services.scm
>> index 8d413e198e..53b358c63b 100644
>> --- a/gnu/services.scm
>> +++ b/gnu/services.scm
>> @@ -91,6 +91,9 @@
>>              ambiguous-target-service-error-service
>>              ambiguous-target-service-error-target-type
>>  
>> +            provenance-entry
>> +            sexp->channel
>
> This ‘sexp->channel’ exists “for historical reasons”.  Could you use
> (@ (guix channels) sexp->channel) instead, together with
> ‘channel-instance->sexp’?

Sure!)

> Actually, could you define it like so:
>
> --8<---------------cut here---------------start------------->8---
> (define home-provenance-service-type
>   (service-type
>    (inherit provenance-service-type)
>    (extensions
>     (list (service-extension
> 	   home-service-type
>            (service-extension-compute
> 	    (first (service-extensions provenance-service-type))))))
>    (default-value #f)))
> --8<---------------cut here---------------end--------------->8---

Looks good to me.

> More generally, perhaps you could have a procedure that takes a service
> type and “rewires” it so that it extends ‘home-service-type’ instead of
> ‘etc-service-type’, say.  Does that make sense?

Thank you for the idea, it can be useful, I'll consider it.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-01 14:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-30  9:45 [bug#49288] [PATCH] gnu: services: Export provenance-entry and sexp->channel Andrew Tropin
2021-07-01 13:37 ` Ludovic Courtès
2021-07-01 14:36   ` Andrew Tropin

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.