[PATCH] home: services: Add home-zathura-service-type.

  • Open
  • quality assurance status badge
Details
4 participants
  • Oleg Pykhalov
  • lgcoelho
  • Ludovic Courtès
  • Sergey Trofimov
Owner
unassigned
Submitted by
lgcoelho
Severity
normal
L
S
S
Sergey Trofimov wrote on 26 Dec 2023 10:33
(address . lgcoelho@disroot.org)
874jg5gvfn.fsf@sarg.org.ru
lgcoelho@disroot.org writes:

Toggle quote (3 lines)
> This service enables a declarative configuration of zathura, the
> customizable document viewer.

I have mixed feelings about pulling 3rd-party software
configurations in guix:
- adding it to guix increases maintenance burden: new versions
could add or remove config options
- it bloats guix: imagine if we add configs for every
user-configurable app
- such configs are not easily transferrable: if I were to use the
same app in non-guix env, I'd have to maintain 2 configs

Another recent example is `oci-container-configuration` which
defines a subset of docker-cli startup arguments. The problem is
that `docker run` command has 96 options and the configuration
only uses a handful, lacking a way to provide the remaining ones.

I think guix should not embed config generators for user software.
The only need I see for such generators is when there are options
which should be the same among multiple applications (e.g. color
schemes or shared directories). For such usecase guix should
provide better text manipulation tools which home owners could use
to parameterise configs.
O
O
Oleg Pykhalov wrote on 26 Dec 2023 13:11
(name . Sergey Trofimov)(address . sarg@sarg.org.ru)(address . 68010@debbugs.gnu.org)
87edf94102.fsf@gmail.com
Hi Sergey,

Sergey Trofimov <sarg@sarg.org.ru> writes:

Toggle quote (18 lines)
> I have mixed feelings about pulling 3rd-party software configurations in guix:
> - adding it to guix increases maintenance burden: new versions could add or
> remove config options
> - it bloats guix: imagine if we add configs for every user-configurable app
> - such configs are not easily transferrable: if I were to use the same app
> in non-guix env, I'd have to maintain 2 configs
>
> Another recent example is `oci-container-configuration` which defines a subset
> of docker-cli startup arguments. The problem is that `docker run` command has
> 96 options and the configuration only uses a handful, lacking a way to provide
> the remaining ones.
>
> I think guix should not embed config generators for user software. The only
> need I see for such generators is when there are options which should be the
> same among multiple applications (e.g. color schemes or shared
> directories). For such usecase guix should provide better text manipulation
> tools which home owners could use to parameterise configs.

It's a bit too off-topic to dive into general configurations in Guix
within the context of the current patch series and should probably be
discussed in a ‘guix-devel’ mailing list or ‘#guix’ IRC channel.


Regards,
Oleg.
-----BEGIN PGP SIGNATURE-----

iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmWKwu4UHGdvLndpZ3Vz
dEBnbWFpbC5jb20ACgkQFn+OpQAa+pxaURAAw42UN+r9+eZZQzwCGMZSfL300als
itxHd8Tn03SGa4vJKCxIkG1/TdiZruTruC8kOYS5JT8C0rtoB6O88G9Yk7n/Gpqg
urrklMbio0YegziKHReFUy5sJVLIrCp1CRLqL3dMBbtVH4jjFodeuB19cYeBGMRp
yBEma+SwlujWrjovAymMitWf9/UBIcEb7XUCLbx8mJ19UZbdlYW1lvkRZN3QOTAk
FV4KVfKFtkqHxd09lR5jpkpq+rdGH4EgE+rhyqZpLMej2ZcQtr7khb0CwkqmnpTP
y4yErk/1f4P9JhwuZcmbdB0QnFwjrn+b3ak2RaE6QmNeEKTlJi7wd97evGJwgGVI
zSLW7WRNW6s9pp6KZZTcI7CeaGGVSRodq9QYszwEAJ3Z6TNSt+Ww0Eh8J70perlT
uqrtbm71MmgLytArfRrJqWGraTkI4Z1XKRBm07DENN/RumH4lLhO+bJNW2zIYQX/
KEmtT9L1Kwyc382tX22eKcpp2pmnr41O/5okfKdYl7ODd2bKrwP9CXVF1iS03VE/
IEkxJ6kMzGoxyr8miRX4oscXl45TrXakinZIsVaLC5ZIsE1tFoXuVwvWO9w4otfj
YxwcrSBwC1hA9KLMHIn/Hzzi/pN/q7RDqIYAqhieni4qsycJ0vDDc1r5TXy3M0Om
2nYBAo5tOQWpvcY=
=w15l
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 8 Jan 09:46 +0100
(name . Sergey Trofimov)(address . sarg@sarg.org.ru)
87wmsk6wlh.fsf@inria.fr
Hello,

Sergey Trofimov <sarg@sarg.org.ru> skribis:

Toggle quote (26 lines)
> lgcoelho@disroot.org writes:
>
>> This service enables a declarative configuration of zathura, the
>> customizable document viewer.
>
> I have mixed feelings about pulling 3rd-party software configurations
> in guix:
> - adding it to guix increases maintenance burden: new versions could
> add or remove config options
> - it bloats guix: imagine if we add configs for every
> user-configurable app
> - such configs are not easily transferrable: if I were to use the
> same app in non-guix env, I'd have to maintain 2 configs
>
> Another recent example is `oci-container-configuration` which defines
> a subset of docker-cli startup arguments. The problem is that `docker
> run` command has 96 options and the configuration only uses a handful,
> lacking a way to provide the remaining ones.
>
> I think guix should not embed config generators for user software. The
> only need I see for such generators is when there are options which
> should be the same among multiple applications (e.g. color schemes or
> shared directories). For such usecase guix should provide better text
> manipulation tools which home owners could use to parameterise
> configs.

I guess it’s a tradeoff. The usual approach for System/Home services
has been to provide “bindings” (a record type) for the config, *plus* an
“escape hatch” (letting users pass raw config as a string).

But you’re right, the expected maintenance burden should be taken into
account. For well-established software and config formats such as Git,
it’s probably okay to have bindings; for things that are more
recent/changing, it’s less obvious. Also, we currently don’t have tests
for Home services, except for those mapped from System services, which
means breakage isn’t automatically detected.

I don’t know whether Zathura falls in the “okay” category or rather in
the “let’s do write bindings” one.

Ludo’.
O
O
Oleg Pykhalov wrote on 23 Jan 14:09 +0100
(address . lgcoelho@disroot.org)(address . 68010@debbugs.gnu.org)
875xzk8adm.fsf@gmail.com
Hello, Luis.

Apologies for delay.

Could you send a new patch with applied following suggestions, please?

lgcoelho@disroot.org writes:

Toggle quote (9 lines)
> This service enables a declarative configuration of zathura, the customizable
> document viewer.
>
> commit 76954ed7dc32ac86ee22566cc03cadc5f9fc1864
> Author: Luis Guilherme Coelho <lgcoelho@disroot.org>
> Date: Sun Dec 24 15:16:43 2023 -0300
>
> home: services: Add home-zathura-service-type

The commit message should look like:
Toggle snippet (6 lines)
home: services: Add zathura service.

* gnu/home/services/zathura.scm: New file.
* doc/guix.texi (SPECIFY SECTION HERE): Document this.

Toggle quote (6 lines)
> diff --git a/gnu/home/services/zathura.scm b/gnu/home/services/zathura.scm
> new file mode 100644
> index 0000000000..0695ce1614
> --- /dev/null
> +++ b/gnu/home/services/zathura.scm

[…]

Toggle quote (12 lines)
> +(define home-zathura-service-type
> + (service-type
> + (name 'zathura-service)
> + (extensions
> + (list (service-extension
> + home-xdg-configuration-files-service-type
> + zathura-xdg-configuration-file-service)))
> + (compose identity)
> + (extend home-zathura-extensions)
> + (default-value (home-zathura-configuration))
> + (description "Set ~/.config/zathura.conf")))

Description should mention that the service configures the Zathura PDF
viewer, e.g.:

Configure the Zathura PDF viewer by providing a
@file{~/.config/zathura.conf} file.

Toggle quote (3 lines)
> +(define (generate-doc)
> + (configuration->documentation 'home-zathura-configuration))

The service documentation should be added to doc/guix.texi file.

See ZNC home service as an example.

Fields documentation could be generated with:
Toggle snippet (14 lines)
~/src/git.savannah.gnu.org/git/guix$ ./pre-inst-env guix repl
GNU Guile 3.0.9
Copyright (C) 1995-2023 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guix-user)> ,m(gnu home services zathura)
scheme@(gnu home services zathura)> (generate-doc)


Thanks,
Oleg.
-----BEGIN PGP SIGNATURE-----

iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmWvunUUHGdvLndpZ3Vz
dEBnbWFpbC5jb20ACgkQFn+OpQAa+pwq2A//bAgiSpWIfwEi7+FDAj49hSp5PyxK
LKNbG5CqFQiLjs8boc4Q9684tBekP2+GmibpVBesk0c6nNtpiviOjjvV1X0sUoCU
qrv/z47X/et0ycs/K6XlspBIWopN4T1iOkDlufjfknvSatE+dInhGvViAV0YrlfQ
t315SSsqNCwvICuXpVNk9QKka8sIi7yWrflt2ixNz23cd1rU7eChoKAP/Obl0R9S
gEM6JXAYxx0NvhlFNqV4XrAD1F4aa1doIS8Tj1vLsjjkD+9wBA8x8YYrvJN5NPDI
WtmXuMt+WAJZuCCiqx140zEsanTVK/vPSefJqBOCqSqs7D2yvtEH2D3hjGsWLxOY
Dxr5P0WEMW4gUzY7ksVlwuMNehw6snMKf75NdIUhG8f3VMexgKZJxHIpLlmSD/KH
5xMuTytFcwKVXfBv1th1+1YHQW7gzbMRPMtKVegBlClWaiLSUokMdt8eRmjOCDj5
BwEvyjxsxO00xClWDOfOJMEtieF/pv7cIGnV2qxelkLaP9RSMWITEk43ZZeyjhpN
S3PYak2+yzp3u5pHdqe1o9gFvMMCleGaC+hRPrV+sP1lRv4jY1JcjUhWjvRCv1UU
WTITYwHaWhzUONxBsTLS38r3d4l/bmMU6TbspwvsUnSWK0diZlLEktKxwsJ8XGdx
xcZ06HbfvikCUJs=
=lB0Z
-----END PGP SIGNATURE-----

O
O
Oleg Pykhalov wrote on 23 Jan 14:13 +0100
(address . lgcoelho@disroot.org)(address . 68010@debbugs.gnu.org)
8734uo8a6u.fsf@gmail.com
Oleg Pykhalov <go.wigust@gmail.com> writes:

Toggle quote (2 lines)
> Could you send a new patch with applied following suggestions, please?

Also, the gnu/local.mk file should include gnu/home/services/zathura.scm
and it should be noted in the Git commit message accordingly, see
‘git log gnu/local.mk’ for an example message.
-----BEGIN PGP SIGNATURE-----

iQJIBAEBCgAyFiEEcjhxI46s62NFSFhXFn+OpQAa+pwFAmWvu2kUHGdvLndpZ3Vz
dEBnbWFpbC5jb20ACgkQFn+OpQAa+pxpNQ/+Mymn0d0+lc0e4dqZfFS/RlJ5C2/5
iNnBM2ymqDAJCpWaaUpePiAGeHtuBNEwDQ9bzDHikfJkWMx8SnfyjCvSnmGQccls
pbQJWNxCsvfZvlBHOi7ZDjnRfpUf5SxP3mknldVNjEbdjhmXXXKka9pMGfDcqo7V
UP18UUFGDd3JuvMKJ6oDmqHUwq70MFoEHpKVp2GTw8A9ohwGc2/l4bg0yYUOCuMV
RltsQO1LmwJKMr+cQ4rOfKWL30G7U7mIZvdAYFnd/NwwfBDn9tM2eSeEtliWapCQ
OU3oZlP+zZ6+VPh/+GZKFq3Yw5fbPcJHMnou+o2I4JasbtkB0ClE8DRv5RS7h3Fh
2jYO4UbKCQpWNGkm0+D9TGpKCKyHugVuV2W0aa/3T1xvRnhTWBUyBXbgwQAEV7Vg
MtcBQxD0881rtGSiW3P9kzcVwqIbYoheIkyA6pHdbtGnGvFcgnGT5X5mdBYMVhoM
fJYBWcnYOo/AZHatJdLjyrZTsFh7sGoH8aFD8nFKAGmuX3KlsP/jAjfpBhvUz/Cl
OypUH18IeyCWt6rICALyrB/1VkYXKna4DJpLj7k3mog4G1QSdn+naIxm+L1BquHE
qvotGtv1Z8orPe6QTz7AAwbDEW/O4MhrMjDuAy04d+JjnzL8cscR8No4khnmbFtD
xQp5vYPNu5KlMok=
=zvpl
-----END PGP SIGNATURE-----

?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 68010@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 68010
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch