From: Andrew Tropin <andrew@trop.in>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 53466@debbugs.gnu.org
Subject: [bug#53466] [PATCH] home: Add redshift service.
Date: Wed, 02 Feb 2022 09:59:11 +0300 [thread overview]
Message-ID: <87fsp1zrcw.fsf@trop.in> (raw)
In-Reply-To: <87v8xz54n9.fsf@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 5298 bytes --]
On 2022-02-01 10:15, Ludovic Courtès wrote:
> Hi Andrew,
>
> We’re drifting away from the practical issue of adding a Redshift
> service, but you raise interesting issues.
That's true, but a few first home services will set the tone for the
rest, so it's probably a good idea to look ahead right now, then later.
>
> Andrew Tropin <andrew@trop.in> skribis:
>
> [...]
>
>>> Yes, that’s the usual tradeoff. The choice made so far in Guix has been
>>> to choose clarity over faithfulness to upstream’s name choices.
>>>
>>
>> Maybe I'm wrong, but it's very likely that most of the users will be
>> checking out upstream documentation anyway during configuration of some
>> programs and those renamings will bring a lot of confusion and
>> especially, when the record fields names will be combined with names in
>> escape hatches.
>
> I think there doesn’t have to be a single answer. For Redshift and its
> handful of options, I see little incentive to go look at ‘man redshift’;
> it doesn’t add much to what we provide.
>
> For more complex services, the answer might be different, although again
> the Dovecot service shows that, even for this big a service, we can
> provide comprehensive bindings and associated documentation.
>
> [...]
>
>>> I can see the appeal of alists, but the choice made in Guix is to use
>>> records for configuration; that has advantages, such as type checking,
>>> detection of incorrect field names, and the ability to use all the bells
>>> and whistles of (guix records).
>>
>> Type checks are possible with data structure driven approach as well and
>> in a fact it's much more flexible and powerful, however to be fair it
>> will require some work to prepare a good framework for that like
>> https://github.com/plumatic/schema
>> or
>> https://github.com/metosin/spec-tools/blob/master/docs/02_data_specs.md
>> for Clojure.
>>
>> It's also possible to generate documentation for such specs.
>>
>> Potentially, such approach is more powerful.
>
> I’m aware of Clojure specs, but I don’t find it convincing compared to
> records, at least for our use case.
>
Ok.
>>>> It would be good to extend home-files-service-type with config-file
>>>> generated above and home-profile-service-type with the value of
>>>> `redshift` field.
>>>
>>> Regarding the former, that’s not something we usually do for system
>>> services.
>>
>> Imagine terminal or almost any other user space program
>
> I’m not imagining: we’re discussing a very concrete service here. :-)
>
> For Redshift, I don’t see the point of making the config available
> globally. For system services, there’s only a handful of exception (PAM
> and OpenSSH come to mind, but see /etc).
>
> Again, there doesn’t have to be a single answer. I suspect many
> services won’t need to make their config available under ~/.config, but
> if some do, so be it. I’d say that the default should be to not make
> config available unless that’s required, just like what we do for system
> services.
>
> How does that sound?
It sounds logical for redshift, but inconsistent in general: some home
services install package to profile, some not, some create config in
XDG_CONFIG_DIR, some not.
I still think that almost all services must provide both package and
configs.
>>> As for the latter, I thought about it but I’m not sure what it would be
>>> used for. WDYT?
>>>
>>
>> It can be used for debugging, for man pages or when redshift don't use
>> shepherd service and started in different way (by wm for example).
>
> The point of this Redshift service is to have it started automatically,
> so to me the only reason to add ‘redshift’ to the user profile would be
> to allow ‘man redshift’.
>
> I don’t view it as super useful in this case, and would instead lean on
> the side of not “polluting” the user’s profile, but I can very well
> imagine that in other cases we’d prefer to extend the user’s profile.
>
>>> I understand your concerns, but I think they’re beyond the scope of this
>>> review. I also think that there’s ample experience with system services
>>> showing that writing “nice” configuration bindings actually works in
>>> practice.
>>
>> I saw how well-written, but macros-based solutions in Clojure ecosystem
>> slowly died and substituted with data-based. I understand that Guile
>> ecosystem has a slightly weaker toolkit for processing datastructures,
>> but by the end of the day I think we will be here sooner or later.
>> Using macros instead of datastructures feels for me like remaking the
>
> Records are data structures, not macros.
>
But, IIRC, define-configuration, define-record-type are.
>> same mistake again knowing the consequences. Maybe I'm wrong.
>
> Maybe one of us is wrong, or maybe it’s more complex than this. :-)
Also, maybe my non-guile experience doesn't apply here.
>
> As it turns out, I find Guix’s configuration records rather nice to
> use—much nicer than, for example, Gnus’ loose configuration trees.
Unfortunately, I'm not familiar with Gnus internals and can't say if
it's related, similar or not.
--
Best regards,
Andrew Tropin
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]
next prev parent reply other threads:[~2022-02-02 7:17 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-23 11:11 [bug#53466] [PATCH] home: Add redshift service Ludovic Courtès
2022-01-28 10:34 ` Andrew Tropin
2022-01-28 18:37 ` Ludovic Courtès
2022-01-31 18:22 ` Andrew Tropin
2022-02-01 9:15 ` Ludovic Courtès
2022-02-02 6:59 ` Andrew Tropin [this message]
2022-02-02 8:57 ` Andrew Tropin
2022-02-08 9:22 ` Ludovic Courtès
2022-03-13 9:52 ` Andrew Tropin
2022-01-30 15:11 ` [bug#53466] [PATCH v2] " Ludovic Courtès
2022-01-30 17:43 ` Maxime Devos
2022-02-01 8:36 ` Ludovic Courtès
2022-01-31 18:57 ` Andrew Tropin
2022-02-01 8:43 ` Ludovic Courtès
2022-02-02 7:48 ` Andrew Tropin
2022-02-06 23:13 ` bug#53466: [PATCH] " Ludovic Courtès
2022-02-07 15:16 ` [bug#53466] " Andrew Tropin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fsp1zrcw.fsf@trop.in \
--to=andrew@trop.in \
--cc=53466@debbugs.gnu.org \
--cc=ludo@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).