[PATCH] gnu: services: Export provenance-entry and sexp->channel

  • Done
  • quality assurance status badge
Details
2 participants
  • Andrew Tropin
  • Ludovic Courtès
Owner
unassigned
Submitted by
Andrew Tropin
Severity
normal
A
A
Andrew Tropin wrote on 30 Jun 2021 11:45
(address . guix-patches@gnu.org)
871r8j4rer.fsf@trop.in
These functions are need for Guix Home.
---
For now functions are copy pasted, but it seems better to reuse
existing functions.
gnu/services.scm | 3 +++
1 file changed, 3 insertions(+)

Toggle diff (19 lines)
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>
L
L
Ludovic Courtès wrote on 1 Jul 2021 15:37
(name . Andrew Tropin)(address . andrew@trop.in)(address . 49288@debbugs.gnu.org)
877diakve4.fsf@gnu.org
Hi!

Andrew Tropin <andrew@trop.in> skribis:

Toggle quote (20 lines)
> 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:

Toggle snippet (11 lines)
(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)))

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’.
A
A
Andrew Tropin wrote on 1 Jul 2021 16:36
(address . 49288@debbugs.gnu.org)
87lf6q3xtu.fsf@trop.in
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (28 lines)
> 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!)

Toggle quote (14 lines)
> 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.

Toggle quote (4 lines)
> 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.
-----BEGIN PGP SIGNATURE-----

iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmDd0v0PHGFuZHJld0B0
cm9wLmluAAoJECII0glYwd6wmbkP/RVQH/aD1uQl+eWYZr2k+3u+jaD8yy/3xxyJ
pos0YIHPWIa1/qtSMODNAMfVHOpPjNOh5wVCzvXQ08KCsG5wrmA6+lY3qY0paxM5
xnfGruDM53jmzgwnir52K2B59rUhIir/xA+/DrTwfyZeqB9AF9kUAW9Y9rN0XQvH
dN/lSNXV7Sg50hxMoQlzVgBBBPwaSu1XKZGU3ZcRASG0Eb2S+ww+qrnWJcBSNtP2
1tiCAYRzuGQ6mbWbjG3DAPN5xyCFZ2cW+9cdDfftix60RYxAKVzmv8itMLd+HEfG
SKdwbz2PVWOqZMILgbUXKvoJaLHm5nzeeE8NWkDxcEDC+WXv524LUoGvOE7hZbKx
kTKWHeSYR7ehFb1kDKQKkE7WKgpBTL25zHy4xSeSRUTGv5gjCBIvlzpwBZYtrEy9
uwjUI1HS9gV8pIkNielQhIR7/iJapgb5sDI20B6DA4HItxJrPVStr2o9cETT4V7/
wVdhXtbuqfCIQtUKrZ4+pa5DGWGGwWQ3ctzxHRMKZ1NsVN2yzrcxKtVAtXDailz9
61ecPo7M7Q/ZCAu7Ah9VjQkSuwK/leuC19pFaP1PsOGeWKNB2K8Wu5bETjfw/UaQ
+yonq9/V4w77ZB/ORt5TwgrdyM4fQJk/w0M+iGoO6RIdw9eb96Vmm+YdPN6s4Lnb
ma5Lvmtg
=0zkn
-----END PGP SIGNATURE-----

?