* Extending home-gpg-agent-service-type from a service-type doesn't do anything?
@ 2025-01-08 22:23 Simen Endsjø
2025-01-11 0:15 ` Tomas Volf
0 siblings, 1 reply; 3+ messages in thread
From: Simen Endsjø @ 2025-01-08 22:23 UTC (permalink / raw)
To: help-guix
I'm probably doing something wrong, but I'm having problems using
`home-gpg-agent-service-type' from a service. It works fine inside an
`home-environment', but not within a service type.
So this works fine:
,----
| (home-environment
| (services
| (list
| (service home-gpg-agent-service-type
| (home-gpg-agent-configuration
| (pinentry-program
| (file-append sijo-pinentry "/bin/sijo-pinentry"))
| (extra-content "allow-loopback-pinentry"))))))
|
`----
But when I move this into a new service, it doesn't seem to do anything,
and only the default configuration is used.
,----
| (home-environment
| (services
| (list
| (service sijo-gpg-service-type))))
|
| (define-public sijo-gpg-service-type
| (service-type
| (name 'sijo-gpg-service)
| (extensions
| (list
| (service-extension home-profile-service-type
| (lambda (config)
| (list sijo-pinentry)))
| ;; This doesn't actually see mto do anything
| (service-extension home-gpg-agent-service-type
| (lambda (config)
| (home-gpg-agent-configuration
| (pinentry-program
| (file-append sijo-pinentry "/bin/sijo-pinentry"))
| (extra-content "allow-loopback-pinentry"))))))
| (default-value #f)
| (description "")))
`----
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Extending home-gpg-agent-service-type from a service-type doesn't do anything?
2025-01-08 22:23 Extending home-gpg-agent-service-type from a service-type doesn't do anything? Simen Endsjø
@ 2025-01-11 0:15 ` Tomas Volf
2025-01-15 15:48 ` Richard Sent
0 siblings, 1 reply; 3+ messages in thread
From: Tomas Volf @ 2025-01-11 0:15 UTC (permalink / raw)
To: Simen Endsjø; +Cc: help-guix
[-- Attachment #1: Type: text/plain, Size: 3450 bytes --]
Simen Endsjø <contact@simendsjo.me> writes:
> I'm probably doing something wrong, but I'm having problems using
> `home-gpg-agent-service-type' from a service. It works fine inside an
> `home-environment', but not within a service type.
>
> So this works fine:
> ,----
> | (home-environment
> | (services
> | (list
> | (service home-gpg-agent-service-type
> | (home-gpg-agent-configuration
> | (pinentry-program
> | (file-append sijo-pinentry "/bin/sijo-pinentry"))
> | (extra-content "allow-loopback-pinentry"))))))
> |
> `----
>
> But when I move this into a new service, it doesn't seem to do anything,
> and only the default configuration is used.
>
> ,----
> | (home-environment
> | (services
> | (list
> | (service sijo-gpg-service-type))))
> |
> | (define-public sijo-gpg-service-type
> | (service-type
> | (name 'sijo-gpg-service)
> | (extensions
> | (list
> | (service-extension home-profile-service-type
> | (lambda (config)
> | (list sijo-pinentry)))
> | ;; This doesn't actually see mto do anything
> | (service-extension home-gpg-agent-service-type
I do not believe the home-gpg-agent-service-type can be extended.
Looking at the source code:
--8<---------------cut here---------------start------------->8---
(define home-gpg-agent-service-type
(service-type
(name 'home-gpg-agent)
(extensions
(list (service-extension home-files-service-type
home-gpg-agent-files)
(service-extension home-shepherd-service-type
home-gpg-agent-shepherd-services)
(service-extension home-activation-service-type
(const gpg-agent-activation))
(service-extension home-environment-variables-service-type
home-gpg-agent-environment-variables)))
(default-value (home-gpg-agent-configuration))
(description
"Configure GnuPG's agent, @command{gpg-agent}, which is responsible for
managing OpenPGP and optionally SSH private keys. When SSH support is
enabled, @command{gpg-agent} acts as a drop-in replacement for OpenSSH's
@command{ssh-agent}.")))
--8<---------------cut here---------------end--------------->8---
And the relevant part of the info manual for `Data Type: service-type':
--8<---------------cut here---------------start------------->8---
‘extend’ (default: ‘#f’)
If this is ‘#f’, services of this type cannot be extended.
--8<---------------cut here---------------end--------------->8---
Since the home-gpg-agent-service-type does not set the `extend' field, I
conclude the service cannot be extended.
However the fact that it does not signal an error is (in my opinion) a
bug and you should report it.
> | (lambda (config)
> | (home-gpg-agent-configuration
> | (pinentry-program
> | (file-append sijo-pinentry "/bin/sijo-pinentry"))
> | (extra-content "allow-loopback-pinentry"))))))
> | (default-value #f)
> | (description "")))
> `----
>
Tomas
--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Extending home-gpg-agent-service-type from a service-type doesn't do anything?
2025-01-11 0:15 ` Tomas Volf
@ 2025-01-15 15:48 ` Richard Sent
0 siblings, 0 replies; 3+ messages in thread
From: Richard Sent @ 2025-01-15 15:48 UTC (permalink / raw)
To: Tomas Volf; +Cc: help-guix, Simen Endsjø
Tomas Volf <~@wolfsden.cz> writes:
> Since the home-gpg-agent-service-type does not set the `extend' field, I
> conclude the service cannot be extended.
>
> However the fact that it does not signal an error is (in my opinion) a
> bug and you should report it.
Thanks for jogging my memory! I believe the relevant report is at
https://issues.guix.gnu.org/71928.
Extending services that don't support extensions does have a valid use
(ensure the service is present), but there isn't an enforced convention
as to what the value used to signal this should be. There is a "soft
convention" around using #t as the extension value, but I'm not sure if
it's universally followed.
Per feedback on the patch I'll see about resubmitting with a warning
instead of an error which should make this situation more obvious.
--
Take it easy,
Richard Sent
Making my computer weirder one commit at a time.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-15 15:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-08 22:23 Extending home-gpg-agent-service-type from a service-type doesn't do anything? Simen Endsjø
2025-01-11 0:15 ` Tomas Volf
2025-01-15 15:48 ` Richard Sent
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.