From unknown Wed Jun 18 23:18:05 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#53466 <53466@debbugs.gnu.org> To: bug#53466 <53466@debbugs.gnu.org> Subject: Status: [PATCH] home: Add redshift service. Reply-To: bug#53466 <53466@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:18:05 +0000 retitle 53466 [PATCH] home: Add redshift service. reassign 53466 guix-patches submitter 53466 Ludovic Court=C3=A8s severity 53466 normal tag 53466 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 23 06:12:27 2022 Received: (at submit) by debbugs.gnu.org; 23 Jan 2022 11:12:27 +0000 Received: from localhost ([127.0.0.1]:38652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBanK-0005Mw-E0 for submit@debbugs.gnu.org; Sun, 23 Jan 2022 06:12:26 -0500 Received: from lists.gnu.org ([209.51.188.17]:50394) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nBanI-0005Mo-Uh for submit@debbugs.gnu.org; Sun, 23 Jan 2022 06:12:25 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52434) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBanH-0005Sj-63 for guix-patches@gnu.org; Sun, 23 Jan 2022 06:12:24 -0500 Received: from [2001:470:142:3::e] (port=40084 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nBanF-0000Z8-8w; Sun, 23 Jan 2022 06:12:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=oqlCjMjzK38TqLJVTTrr+Cmv92Xm7qRoLmYU3+5In/4=; b=iOV9gF3pLp2V33 j/mI81iEgsU9C3O/T+8uOhG1CpXc649W7Px/B4HORY3fqmW6ptc3VVFTsCcf6Rl+kU/0gX0UlcJOo DmBMsjnonyGjoxtbS+VRj7AJdpCWxcvWitenShui8PG9xRoX4Z29Ol8MHE+3EWr6kpE5uTGF1MfBY QWItDN/zNzFnYt0/VQoU3mwU9iPDzElBYX+cErZM0zE+YDcloO0TWLCsBB9Vp8QJP9erLWA4mcM/j F2hqrsXKr13CdQJbUkG0fSiVw4fkE65lnwWcsu9VL8wlbsMhFj7GGJjKIqm3KcHns6wNsmnwlqkgN 7LIVvqkuOF6bxLo0ssyw==; Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57242 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nBan4-00030U-F0; Sun, 23 Jan 2022 06:12:20 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH] home: Add redshift service. Date: Sun, 23 Jan 2022 12:11:59 +0100 Message-Id: <20220123111159.27020-1-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/home/services/desktop.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * doc/guix.texi (Desktop Home Services): New node. --- doc/guix.texi | 62 ++++++++++++++++ gnu/home/services/desktop.scm | 135 ++++++++++++++++++++++++++++++++++ gnu/local.mk | 1 + 3 files changed, 198 insertions(+) create mode 100644 gnu/home/services/desktop.scm diff --git a/doc/guix.texi b/doc/guix.texi index 912a8e3c5a..07414ec13d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -37186,6 +37186,7 @@ services)}. * Shells: Shells Home Services. POSIX shells, Bash, Zsh. * Mcron: Mcron Home Service. Scheduled User's Job Execution. * Shepherd: Shepherd Home Service. Managing User's Daemons. +* Desktop: Desktop Home Services. Services for graphical environments. @end menu @c In addition to that Home Services can provide @@ -37567,6 +37568,67 @@ mechanism instead (@pxref{Shepherd Services}). @end table @end deftp +@node Desktop Home Services +@subsection Desktop Home Services + +The @code{(gnu home services desktop)} module provides services that you +may find useful on ``desktop'' systems running a graphical user +environment such as Xorg. + +@defvr {Scheme Variable} home-redshift-service-type +This is the service type for @uref{https://github.com/jonls/redshift, +Redshift}, a program that adjusts the display color temperature +according to the time of day. Its associated value must be a +@code{home-redshift-configuration} record, as shown below. + +A typical configuration, where we manually specify the latitude and +longitude, might look like this: + +@lisp +(service home-redshift-service-type + (home-redshift-configuration + (location-provider 'manual) + (latitude 35.81) ;northern hemisphere + (longitude -0.80))) ;west of Greenwich +@end lisp +@end defvr + +@deftp {Data Type} home-redshift-configuration +Available @code{home-redshift-configuration} fields are: + +@table @asis +@item @code{location-provider} (default: @code{geoclue2}) (type: symbol) +Geolocation provider---@code{'manual} or @code{'geoclue2}. In the +former case, you must also specify the @code{latitude} and +@code{longitude} fields so Redshift can determine daytime at your place. +In the latter case, the Geoclue system service must be running; it will +be queried for location information. + +@item @code{adjustment-method} (default: @code{randr}) (type: symbol) +Color adjustment method. + +@item @code{daytime-temperature} (default: @code{6500}) (type: integer) +Daytime color temperature (kelvins). + +@item @code{nighttime-temperature} (default: @code{4500}) (type: integer) +Nighttime color temperature (kelvins). + +@item @code{daytime-brightness} (default: @code{disabled}) (type: maybe-inexact-number) +Daytime screen brightness, between 0.1 and 1.0. + +@item @code{nighttime-brightness} (default: @code{disabled}) (type: maybe-inexact-number) +Nighttime screen brightness, between 0.1 and 1.0. + +@item @code{latitude} (default: @code{disabled}) (type: maybe-inexact-number) +Latitude, when @code{location-provider} is @code{'manual}. + +@item @code{longitude} (default: @code{disabled}) (type: maybe-inexact-number) +Longitude, when @code{location-provider} is @code{'manual}. + +@end table + +@end deftp + @node Invoking guix home @section Invoking @code{guix home} diff --git a/gnu/home/services/desktop.scm b/gnu/home/services/desktop.scm new file mode 100644 index 0000000000..36e02e671f --- /dev/null +++ b/gnu/home/services/desktop.scm @@ -0,0 +1,135 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu home services desktop) + #:use-module (gnu home services) + #:use-module (gnu home services shepherd) + #:use-module (gnu services configuration) + #:autoload (gnu packages xdisorg) (redshift) + #:use-module (guix records) + #:use-module (guix gexp) + #:use-module (srfi srfi-1) + #:use-module (ice-9 match) + #:export (home-redshift-configuration + home-redshift-configuration? + + home-redshift-service-type)) + + +;;; +;;; Redshift. +;;; + +(define (serialize-integer field value) + (string-append (match field + ('daytime-temperature "temp-day") + ('nighttime-temperature "temp-night") + ('daytime-brightness "brightness-day") + ('nighttime-brightness "brightness-night") + ('latitude "lat") + ('longitude "lon") + (_ (symbol->string field))) + "=" (number->string value) "\n")) + +(define (serialize-symbol field value) + (string-append (symbol->string field) + "=" (symbol->string value) "\n")) + +(define serialize-inexact-number serialize-integer) + +(define (inexact-number? n) + (and (number? n) (inexact? n))) +(define-maybe inexact-number) + +(define-configuration home-redshift-configuration + (location-provider + (symbol 'geoclue2) + "Geolocation provider---@code{'manual} or @code{'geoclue2}. + +In the former case, you must also specify the @code{latitude} and +@code{longitude} fields so Redshift can determine daytime at your place. In +the latter case, the Geoclue system service must be running; it will be +queried for location information.") + (adjustment-method + (symbol 'randr) + "Color adjustment method.") + + ;; Default values from redshift(1). + (daytime-temperature + (integer 6500) + "Daytime color temperature (kelvins).") + (nighttime-temperature + (integer 4500) + "Nighttime color temperature (kelvins).") + + (daytime-brightness + (maybe-inexact-number 'disabled) + "Daytime screen brightness, between 0.1 and 1.0.") + (nighttime-brightness + (maybe-inexact-number 'disabled) + "Nighttime screen brightness, between 0.1 and 1.0.") + + (latitude + (maybe-inexact-number 'disabled) + "Latitude, when @code{location-provider} is @code{'manual}.") + (longitude + (maybe-inexact-number 'disabled) + "Longitude, when @code{location-provider} is @code{'manual}.")) + +(define (serialize-redshift-configuration config) + (define location-fields + '(latitude longitude)) + + (define (location-field? field) + (memq (configuration-field-name field) location-fields)) + + #~(string-append + "[redshift]\n" + #$(serialize-configuration config + (remove location-field? + home-redshift-configuration-fields)) + "\n[manual]\n" + #$(serialize-configuration config + (filter location-field? + home-redshift-configuration-fields)))) + +(define (redshift-shepherd-service config) + (define config-file + (computed-file "redshift.conf" + #~(call-with-output-file #$output + (lambda (port) + (display #$(serialize-redshift-configuration config) + port))))) + + (list (shepherd-service + (documentation "Redshift program.") + (provision '(redshift)) + (start #~(make-forkexec-constructor + (list #$(file-append redshift "/bin/redshift") + "-c" #$config-file))) + (stop #~(make-kill-destructor))))) + +(define home-redshift-service-type + (service-type + (name 'home-redshift) + (extensions (list (service-extension home-shepherd-service-type + redshift-shepherd-service))) + (default-value (home-redshift-configuration)) + (description + "Run Redshift, a program that adjust the color temperature of display +according to time of day."))) diff --git a/gnu/local.mk b/gnu/local.mk index 03f6d90b9e..cf72926f5d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -78,6 +78,7 @@ GNU_SYSTEM_MODULES = \ %D%/ci.scm \ %D%/home.scm \ %D%/home/services.scm \ + %D%/home/services/desktop.scm \ %D%/home/services/symlink-manager.scm \ %D%/home/services/fontutils.scm \ %D%/home/services/shells.scm \ base-commit: ee6bf00b2d89f6acab55b7a82896d99e39c1229b -- 2.34.0 From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 28 05:34:48 2022 Received: (at 53466) by debbugs.gnu.org; 28 Jan 2022 10:34:48 +0000 Received: from localhost ([127.0.0.1]:57544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDOad-0003pI-NR for submit@debbugs.gnu.org; Fri, 28 Jan 2022 05:34:48 -0500 Received: from mail-lj1-f177.google.com ([209.85.208.177]:36416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDOab-0003p5-O2 for 53466@debbugs.gnu.org; Fri, 28 Jan 2022 05:34:46 -0500 Received: by mail-lj1-f177.google.com with SMTP id j14so8392477lja.3 for <53466@debbugs.gnu.org>; Fri, 28 Jan 2022 02:34:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=lwEqW0KAQfnUUiUuz3TeLFjxIYZh9V/8ZNjBfEzjKHw=; b=VnURf3CX4l46oam0penHx+v82Jglzpu7ja9P6O+zYjp712W2MlV7ruuUQyDi29mooh D7ymA8fwogiVb3NjkpYdQA98xPCmhzxgjn3NaALD4dJePZgGi/oSrimDF4kVpoeqzw+L VhtEPxewv2MbjJeY/sQcC4Uu2BoYhvQ+DIZjeIGmtr7T/1hnkhIU++s2UqPBUeO2LLDl Vx7o4pvcROdijw/NrxXdie5Myl1V+gQCbWzw9OYNHOiUtr0W7yuauNmVJIwfiP+HEeil mqAyWPVoAFMK9XAEHusuITngE4/74g7DQyRJ+XJBwOO2YUqW/hwlgv/Srab1Feo5SweD XJ0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=lwEqW0KAQfnUUiUuz3TeLFjxIYZh9V/8ZNjBfEzjKHw=; b=YMpB9XrlxbxF9h3jZjIhHT1P+TLDzIqp0wF+gR0HDsp2agGjFvBTzviqS6WX4viz27 tAE90eyTCi9d+eWdgM6/pdbxFwpk3otsghSi1dPUTde00zEgnOr62YnGzEt6I5IZkHrm Py4kexJldTZ/ElZ88Oy2RIgeIcjvnRjfPI7imE/+PKEPMfiLum5Vne4nKxKpFMUiqXUi 5PhqMK103yGCl4gQaF3yO4P+r2GcpxlF9SLzSCIl9yjaeUtC+meHqcaar9Ep4+rym/ej tRnN6A01vJt8jAEBbRIdWUzjOajgZaorKwcWZ8uKl+S+pAA4NgtEjQezUcKIn7vkQEeJ GRfg== X-Gm-Message-State: AOAM532BJLy4T4g0pLKm6qpQ8h8ZuZSO0zmXdQFQpid9Lbz2IGKc9xkj xHmVyiq51gAGA/UCj2OQaqigPYDiavhgHA== X-Google-Smtp-Source: ABdhPJwG9+Z3GLZ5AUYf66ULD4fiDVkYjEsgp6x1UuYkwFsJygaRRwNoP0xxchhTfXJZEW6ngAdbhw== X-Received: by 2002:a2e:7d04:: with SMTP id y4mr24895ljc.87.1643366079293; Fri, 28 Jan 2022 02:34:39 -0800 (PST) Received: from localhost (109-252-135-33.dynamic.spd-mgts.ru. [109.252.135.33]) by smtp.gmail.com with ESMTPSA id cf32sm1028341lfb.133.2022.01.28.02.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jan 2022 02:34:38 -0800 (PST) From: Andrew Tropin To: Ludovic =?utf-8?Q?Court=C3=A8s?= , 53466@debbugs.gnu.org Subject: Re: [bug#53466] [PATCH] home: Add redshift service. In-Reply-To: <20220123111159.27020-1-ludo@gnu.org> References: <20220123111159.27020-1-ludo@gnu.org> Date: Fri, 28 Jan 2022 13:34:35 +0300 Message-ID: <87sft8tah0.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53466 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-01-23 12:11, Ludovic Court=C3=A8s wrote: > * gnu/home/services/desktop.scm: New file. > * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. > * doc/guix.texi (Desktop Home Services): New node. > --- > doc/guix.texi | 62 ++++++++++++++++ > gnu/home/services/desktop.scm | 135 ++++++++++++++++++++++++++++++++++ > gnu/local.mk | 1 + > 3 files changed, 198 insertions(+) > create mode 100644 gnu/home/services/desktop.scm > > diff --git a/doc/guix.texi b/doc/guix.texi > index 912a8e3c5a..07414ec13d 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -37186,6 +37186,7 @@ services)}. > * Shells: Shells Home Services. POSIX shells, Bash, Zsh. > * Mcron: Mcron Home Service. Scheduled User's Job Execution. > * Shepherd: Shepherd Home Service. Managing User's Daemons. > +* Desktop: Desktop Home Services. Services for graphical environm= ents. > @end menu > @c In addition to that Home Services can provide >=20=20 > @@ -37567,6 +37568,67 @@ mechanism instead (@pxref{Shepherd Services}). > @end table > @end deftp >=20=20 > +@node Desktop Home Services > +@subsection Desktop Home Services > + > +The @code{(gnu home services desktop)} module provides services that you > +may find useful on ``desktop'' systems running a graphical user > +environment such as Xorg. > + > +@defvr {Scheme Variable} home-redshift-service-type > +This is the service type for @uref{https://github.com/jonls/redshift, > +Redshift}, a program that adjusts the display color temperature > +according to the time of day. Its associated value must be a > +@code{home-redshift-configuration} record, as shown below. > + > +A typical configuration, where we manually specify the latitude and > +longitude, might look like this: > + > +@lisp > +(service home-redshift-service-type > + (home-redshift-configuration > + (location-provider 'manual) > + (latitude 35.81) ;northern hemisphere > + (longitude -0.80))) ;west of Greenwich > +@end lisp > +@end defvr > + > +@deftp {Data Type} home-redshift-configuration > +Available @code{home-redshift-configuration} fields are: > + > +@table @asis > +@item @code{location-provider} (default: @code{geoclue2}) (type: symbol) > +Geolocation provider---@code{'manual} or @code{'geoclue2}. In the > +former case, you must also specify the @code{latitude} and > +@code{longitude} fields so Redshift can determine daytime at your place. > +In the latter case, the Geoclue system service must be running; it will > +be queried for location information. > + > +@item @code{adjustment-method} (default: @code{randr}) (type: symbol) > +Color adjustment method. > + > +@item @code{daytime-temperature} (default: @code{6500}) (type: integer) > +Daytime color temperature (kelvins). > + > +@item @code{nighttime-temperature} (default: @code{4500}) (type: integer) > +Nighttime color temperature (kelvins). > + > +@item @code{daytime-brightness} (default: @code{disabled}) (type: maybe-= inexact-number) > +Daytime screen brightness, between 0.1 and 1.0. > + > +@item @code{nighttime-brightness} (default: @code{disabled}) (type: mayb= e-inexact-number) > +Nighttime screen brightness, between 0.1 and 1.0. > + > +@item @code{latitude} (default: @code{disabled}) (type: maybe-inexact-nu= mber) > +Latitude, when @code{location-provider} is @code{'manual}. > + > +@item @code{longitude} (default: @code{disabled}) (type: maybe-inexact-n= umber) > +Longitude, when @code{location-provider} is @code{'manual}. > + > +@end table > + > +@end deftp > + > @node Invoking guix home > @section Invoking @code{guix home} >=20=20 > diff --git a/gnu/home/services/desktop.scm b/gnu/home/services/desktop.scm > new file mode 100644 > index 0000000000..36e02e671f > --- /dev/null > +++ b/gnu/home/services/desktop.scm > @@ -0,0 +1,135 @@ > +;;; GNU Guix --- Functional package management for GNU > +;;; Copyright =C2=A9 2022 Ludovic Court=C3=A8s > +;;; > +;;; This file is part of GNU Guix. > +;;; > +;;; GNU Guix is free software; you can redistribute it and/or modify it > +;;; under the terms of the GNU General Public License as published by > +;;; the Free Software Foundation; either version 3 of the License, or (at > +;;; your option) any later version. > +;;; > +;;; GNU Guix is distributed in the hope that it will be useful, but > +;;; WITHOUT ANY WARRANTY; without even the implied warranty of > +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +;;; GNU General Public License for more details. > +;;; > +;;; You should have received a copy of the GNU General Public License > +;;; along with GNU Guix. If not, see . > + > +(define-module (gnu home services desktop) > + #:use-module (gnu home services) > + #:use-module (gnu home services shepherd) > + #:use-module (gnu services configuration) > + #:autoload (gnu packages xdisorg) (redshift) > + #:use-module (guix records) > + #:use-module (guix gexp) > + #:use-module (srfi srfi-1) > + #:use-module (ice-9 match) > + #:export (home-redshift-configuration > + home-redshift-configuration? > + > + home-redshift-service-type)) > + > + > +;;; > +;;; Redshift. > +;;; > + > +(define (serialize-integer field value) > + (string-append (match field > + ('daytime-temperature "temp-day") > + ('nighttime-temperature "temp-night") > + ('daytime-brightness "brightness-day") > + ('nighttime-brightness "brightness-night") > + ('latitude "lat") > + ('longitude "lon") > + (_ (symbol->string field))) > + "=3D" (number->string value) "\n")) > + > +(define (serialize-symbol field value) > + (string-append (symbol->string field) > + "=3D" (symbol->string value) "\n")) > + > +(define serialize-inexact-number serialize-integer) > + > +(define (inexact-number? n) > + (and (number? n) (inexact? n))) > +(define-maybe inexact-number) > + > +(define-configuration home-redshift-configuration (redshift (package redshift)) would be useful, especially for people who would like to use a patched redshift supporting wayland or some other extended version of a package. Another good candidate for a separate field is shepherd? or shepherd-service? to make it possible to remove an integration with shepherd if it's not needed. > + (location-provider > + (symbol 'geoclue2) > + "Geolocation provider---@code{'manual} or @code{'geoclue2}. > + > +In the former case, you must also specify the @code{latitude} and > +@code{longitude} fields so Redshift can determine daytime at your place.= In > +the latter case, the Geoclue system service must be running; it will be > +queried for location information.") > + (adjustment-method > + (symbol 'randr) > + "Color adjustment method.") > + > + ;; Default values from redshift(1). > + (daytime-temperature > + (integer 6500) > + "Daytime color temperature (kelvins).") > + (nighttime-temperature > + (integer 4500) > + "Nighttime color temperature (kelvins).") > + > + (daytime-brightness > + (maybe-inexact-number 'disabled) > + "Daytime screen brightness, between 0.1 and 1.0.") > + (nighttime-brightness > + (maybe-inexact-number 'disabled) > + "Nighttime screen brightness, between 0.1 and 1.0.") > + > + (latitude > + (maybe-inexact-number 'disabled) > + "Latitude, when @code{location-provider} is @code{'manual}.") > + (longitude > + (maybe-inexact-number 'disabled) > + "Longitude, when @code{location-provider} is @code{'manual}.")) While I like the naming of the fields more than original option names I still not a big fan of this approach for various reasons: 1. Users of this home service would need to deal with one more level of abstraction and keep in mind latitude -> manual.lat, nighttime-brightness -> redshift.brightness-night, etc mappings. Maybe for completely new users it's not even necessary to think about internals, but for person reading man pages or non-guix specific articles it would be a headache. It's not that bad for very simple programs like redshift, but becomes much more significant for software supporting much more options like sway or git. 2. With the current configuration implementation 8 options are missing and not possible to set, also it's not possible to reuse already existing configuration. Escape hatch with extra-content field solves this problem only partially and extra-content can NOT be combined with the rest of fields representing redshift options. So it should be a named a "file", not extra-content, and when used will remove the effect of all other fields. extra-options is possible but will blow the mind, we have mappings and all that stuff, also need a custom serialization logic to merge sections. 3. We copy the documentation and part of implementation for software we are wrapping and now we have to maintain it ourselves. Probably, redshift is quite stable and both documentation and options doesn't change frequently, but for the bigger projects it will lead to outdated docs and missing options quite fast or will put a huge maintanance burden. 4. If we decide one day to continue development of guix home import command it would be a little nightmare to write importers from existing configuration to guix services configurations. I would prefer to have one config field for all the fields above: (redshift-conf '((redshift ((temp-day . 5700) (temp-night . 3600) (gamma . 0.8) ;; any other number of option some one would like to set #~"dawn-time=3D6:00\ndusk-time=3D18:00" ;; or a nasty slurp-file-gexp, which reads the existing ;; configuration or part of it if we migrate step by step (adjustment-method . randr) (location-provider . manual))) (manual ((lat . 55.7) (lon . 12.6))))) So final configuration will be something like: (define-configuration home-redshift-configuration (redshift (package redshift) "The redshift package to use.") (shepherd-service? (boolean #t) "Add a redshift service to user's shepherd?") (redshift-conf (conf-config '()) "The configuration, which will go to ~/.config/redshift.conf, Here is an example: ... To get info about all options see @code{man 1 redshift}")) Doing so we lose some explorability provided by geiser, because we don't have separate record fields for each option any more, but get much more maintainable and simplier configuration implementation. We don't lose type checking: we can use redshift-config instead of conf-config and implement proper type checking if we want, a little harder than with macros on top of records, but not impossible and probably much more flexible (we have access not only to the value of the current option, but to the whole configuration). > + > +(define (serialize-redshift-configuration config) > + (define location-fields > + '(latitude longitude)) > + > + (define (location-field? field) > + (memq (configuration-field-name field) location-fields)) > + > + #~(string-append > + "[redshift]\n" > + #$(serialize-configuration config > + (remove location-field? > + home-redshift-configuration-fiel= ds)) > + "\n[manual]\n" > + #$(serialize-configuration config > + (filter location-field? > + home-redshift-configuration-fiel= ds)))) > + > +(define (redshift-shepherd-service config) > + (define config-file > + (computed-file "redshift.conf" > + #~(call-with-output-file #$output > + (lambda (port) > + (display #$(serialize-redshift-configuration co= nfig) > + port))))) > + > + (list (shepherd-service > + (documentation "Redshift program.") > + (provision '(redshift)) > + (start #~(make-forkexec-constructor There is a possibility that shepherd is launched before X or wayland session started and redshift won't be able to access necessary environment variables. I have a few hacky solutions for other applications, but need to come up with a better and more generic way to handle it. > + (list #$(file-append redshift "/bin/redshift") > + "-c" #$config-file))) > + (stop #~(make-kill-destructor))))) > + > +(define home-redshift-service-type > + (service-type > + (name 'home-redshift) > + (extensions (list (service-extension home-shepherd-service-type > + redshift-shepherd-service))) 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. This way user will be able to launch redshift himself or using other mechanism like wm startup file, it maybe necessary for testing/debugging purpose or to be sure that redshift has DISPLAY or other variables available or maybe some other use cases. > + (default-value (home-redshift-configuration)) > + (description > + "Run Redshift, a program that adjust the color temperature of display > +according to time of day."))) > diff --git a/gnu/local.mk b/gnu/local.mk > index 03f6d90b9e..cf72926f5d 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -78,6 +78,7 @@ GNU_SYSTEM_MODULES =3D \ > %D%/ci.scm \ > %D%/home.scm \ > %D%/home/services.scm \ > + %D%/home/services/desktop.scm \ > %D%/home/services/symlink-manager.scm \ > %D%/home/services/fontutils.scm \ > %D%/home/services/shells.scm \ > > base-commit: ee6bf00b2d89f6acab55b7a82896d99e39c1229b Yes, it's possible to use the approach proposed by this patch for implementing configuration for such simple program, but I still have a lot of concerns about applying it to more complex software. Related discussions: https://issues.guix.gnu.org/52698 https://yhetil.org/guix-devel/87h79qx5db.fsf@trop.in/ =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmHzxrsPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wDTwQAJEAFoXRfWVUwjUGO+ZMGt5zMeWuBS58PF3a bAtiWBJjaIg5IIwWe4jcUjAJODhKRylYriDL4Y8/2ejc0gQzsdsFTa7d0jHXDkrc q57QUBPVDBSrYDqMOBsj70brBGiiVvOALRTFFWxD9sqN9zKLGHVu5UAnKpBoSA43 CZ7Tfld+HMKDR/Cr0L07jD4AunGoZSU1GWvLKjYzDbVCfTLzt2rj6Mw94AuIHvez F3fJRfaYwC1tmNlr0l5gJLLOcTZG+MzlYqjm4NR089Z7kAQRAe0oQy24G+MfkVSf Blp+7kJwPd0cjUzNLLQRUaJ7xiKe02BlMJQFa8f9wXDyufTRlo34AX1xUIpMsysS ZkSO32pm/iqhHrnw47QY7n5EB2qPvh4K/UhPMOpW7CqpR5yx1YD4Tl/QOkySBdl7 xKfzMY9uY7MBhR6kZZ0eCBh3V0ImGNJM1NxNARqPjQ2dp/rDENPGX2ZMz6D1rhjh Ai59jv1tvynHWqJ69lks4IXPqliosSZsR1fFbOh/K723x+FMVpv8pa+PERImX4ks xZkYo4rTd3yhTG3rwOcyhiWhkemkyMt/VAtliF+AXIdbVP/zNUEGB1swW6lBvTps Y6mzYrKlr4E2zO8ocRKioQtL0Mnr1HgL82VSjTFKIBkWArsAcgNkrG4njD4K613G Egd3GP+Y =hs0n -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 28 13:37:47 2022 Received: (at 53466) by debbugs.gnu.org; 28 Jan 2022 18:37:48 +0000 Received: from localhost ([127.0.0.1]:60502 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDW83-0002ml-F7 for submit@debbugs.gnu.org; Fri, 28 Jan 2022 13:37:47 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:55570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDW82-0002mV-69 for 53466@debbugs.gnu.org; Fri, 28 Jan 2022 13:37:46 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 2D8A13D7; Fri, 28 Jan 2022 19:37:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yn3mDqpI547c; Fri, 28 Jan 2022 19:37:37 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 493753D6; Fri, 28 Jan 2022 19:37:37 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Andrew Tropin Subject: Re: [bug#53466] [PATCH] home: Add redshift service. References: <20220123111159.27020-1-ludo@gnu.org> <87sft8tah0.fsf@trop.in> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 9 =?utf-8?Q?Pluvi=C3=B4se?= an 230 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 28 Jan 2022 19:37:35 +0100 In-Reply-To: <87sft8tah0.fsf@trop.in> (Andrew Tropin's message of "Fri, 28 Jan 2022 13:34:35 +0300") Message-ID: <87zgnfbtao.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: 2D8A13D7 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 53466 Cc: 53466@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi Andrew, Andrew Tropin skribis: > On 2022-01-23 12:11, Ludovic Court=C3=A8s wrote: > >> * gnu/home/services/desktop.scm: New file. >> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. >> * doc/guix.texi (Desktop Home Services): New node. [...] >> +(define-configuration home-redshift-configuration > > (redshift > (package redshift)) > > would be useful, especially for people who would like to use a patched > redshift supporting wayland or some other extended version of a package. Oops, indeed; I=E2=80=99ll add it. > Another good candidate for a separate field is shepherd? or > shepherd-service? to make it possible to remove an integration with > shepherd if it's not needed. What would the service do when set to #f? >> + (latitude >> + (maybe-inexact-number 'disabled) >> + "Latitude, when @code{location-provider} is @code{'manual}.") >> + (longitude >> + (maybe-inexact-number 'disabled) >> + "Longitude, when @code{location-provider} is @code{'manual}.")) > > While I like the naming of the fields more than original option names I > still not a big fan of this approach for various reasons: For the record, the whole project avoids abbreviations. I think it=E2=80= =99s an important part of making things intelligible, especially to non-native speakers. > 1. Users of this home service would need to deal with one more level of > abstraction and keep in mind latitude -> manual.lat, > nighttime-brightness -> redshift.brightness-night, etc mappings. Maybe > for completely new users it's not even necessary to think about > internals, but for person reading man pages or non-guix specific > articles it would be a headache. It's not that bad for very simple > programs like redshift, but becomes much more significant for software > supporting much more options like sway or git. Yes, that=E2=80=99s the usual tradeoff. The choice made so far in Guix has= been to choose clarity over faithfulness to upstream=E2=80=99s name choices. > 2. With the current configuration implementation 8 options are missing > and not possible to set, also it's not possible to reuse already > existing configuration. Oops yes, I=E2=80=99ll add an escape hatch. > Escape hatch with extra-content field solves this problem only > partially and extra-content can NOT be combined with the rest of > fields representing redshift options. So it should be a named a > "file", not extra-content, and when used will remove the effect of all > other fields. extra-options is possible but will blow the mind, we > have mappings and all that stuff, also need a custom serialization > logic to merge sections. I=E2=80=99ll look into it, and I think that=E2=80=99ll help me understand w= hy this file-like vs. string is so important to you. > 3. We copy the documentation and part of implementation for software we > are wrapping and now we have to maintain it ourselves. Probably, > redshift is quite stable and both documentation and options doesn't > change frequently, but for the bigger projects it will lead to outdated > docs and missing options quite fast or will put a huge maintanance > burden. Yes. Again, that=E2=80=99s the choice we made in Guix: providing bindings = for config file formats. It=E2=80=99s ambitious, but it=E2=80=99s worked well = so far. If it worked for the Dovecot, surely it won=E2=80=99t be a problem here. :-) > 4. If we decide one day to continue development of guix home import > command it would be a little nightmare to write importers from existing > configuration to guix services configurations. I view =E2=80=98guix home import=E2=80=99 as a helper, like =E2=80=98guix i= mport=E2=80=99. I don=E2=80=99t think it would make sense to have it automatically handle all the config files that could possibly be handled by Guix Home services. > I would prefer to have one config field for all the fields above: > > (redshift-conf > '((redshift > ((temp-day . 5700) > (temp-night . 3600) > (gamma . 0.8) > ;; any other number of option some one would like to set > #~"dawn-time=3D6:00\ndusk-time=3D18:00" > ;; or a nasty slurp-file-gexp, which reads the existing > ;; configuration or part of it if we migrate step by step > (adjustment-method . randr) > (location-provider . manual))) > (manual > ((lat . 55.7) > (lon . 12.6))))) 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). [...] >> + (list (shepherd-service >> + (documentation "Redshift program.") >> + (provision '(redshift)) >> + (start #~(make-forkexec-constructor > > There is a possibility that shepherd is launched before X or wayland > session started and redshift won't be able to access necessary > environment variables. I have a few hacky solutions for other > applications, but need to come up with a better and more generic way to > handle it. Oh, I see. I=E2=80=99ll add a FIXME. In practice, that problem would mani= fest only if someone logs in at the console first, right? Perhaps we could define a pseudo =E2=80=98xserver-xorg=E2=80=99 Shepherd se= rvice that would be down when =E2=80=98DISPLAY=E2=80=99 is undefined, or something lik= e that? >> + (list #$(file-append redshift "/bin/redshift") >> + "-c" #$config-file))) >> + (stop #~(make-kill-destructor))))) >> + >> +(define home-redshift-service-type >> + (service-type >> + (name 'home-redshift) >> + (extensions (list (service-extension home-shepherd-service-type >> + redshift-shepherd-service))) > > 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=E2=80=99s not something we usually do for system services. As for the latter, I thought about it but I=E2=80=99m not sure what it woul= d be used for. WDYT? > This way user will be able to launch redshift himself or using other > mechanism like wm startup file, it maybe necessary for > testing/debugging purpose or to be sure that redshift has DISPLAY or > other variables available or maybe some other use cases. In that case it may be best to let users explicitly install it in their profile maybe? > Yes, it's possible to use the approach proposed by this patch for > implementing configuration for such simple program, but I still have > a lot of concerns about applying it to more complex software. I understand your concerns, but I think they=E2=80=99re beyond the scope of= this review. I also think that there=E2=80=99s ample experience with system ser= vices showing that writing =E2=80=9Cnice=E2=80=9D configuration bindings actually= works in practice. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 30 10:12:00 2022 Received: (at 53466) by debbugs.gnu.org; 30 Jan 2022 15:12:00 +0000 Received: from localhost ([127.0.0.1]:37333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEBrz-0006yv-Vw for submit@debbugs.gnu.org; Sun, 30 Jan 2022 10:12:00 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57354) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEBrx-0006yh-TS for 53466@debbugs.gnu.org; Sun, 30 Jan 2022 10:11:58 -0500 Received: from [2001:470:142:3::e] (port=48328 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nEBrs-0001dC-JR; Sun, 30 Jan 2022 10:11:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=JZtxloQLyAwbaWffjV/wInNAnTFb9R0byl/Zpx6EgBY=; b=Bmc2UNrb3eKKu+E6lSUQ vBDQBxWK+dWf2p7mSrzjVjrgedZprk8xouARa8gObuLng+XB7AdaId0UWZ70jZ3LW1PkgthMO1xq+ +JMi2Wytnj1pStBtw/s92ujUuOBHE0jeDT7M6v6p5hna2YHcA5ot14RQX2RdkFC9vrzbsBFWVGtjQ qGD8Q/Uag4wzUj0UzLNpjA03B8tnwfaZPaBieijs2Kfp5MmhBQR8LpPnxRgJZOXXGctckyeBX/aIx ebGloHDznk4Dok1ODX8InbxjAyHusMyQKMPySbHhsTcUobct5VlO72SRnFwGCQKuDf2oc4FjyFSmp +iK36G8gXQ92GA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:60174 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nEBrs-0000rO-3m; Sun, 30 Jan 2022 10:11:52 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: 53466@debbugs.gnu.org Subject: [PATCH v2] home: Add redshift service. Date: Sun, 30 Jan 2022 16:11:39 +0100 Message-Id: <20220130151139.3857-1-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <87sft8tah0.fsf@trop.in> References: <87sft8tah0.fsf@trop.in> MIME-Version: 1.0 X-Debbugs-Cc: Andrew Tropin Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 53466 Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/home/services/desktop.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. * doc/guix.texi (Desktop Home Services): New node. --- doc/guix.texi | 70 +++++++++++++++ gnu/home/services/desktop.scm | 158 ++++++++++++++++++++++++++++++++++ gnu/local.mk | 1 + 3 files changed, 229 insertions(+) create mode 100644 gnu/home/services/desktop.scm Hello! Changes compared to v1 account for Andrew’s suggestions: • add ‘redshift’ field to specify the package to use; • add ‘extra-content’ field as an escape hatch. We could debate about the latter; from a pragmatic standpoint, I think it gives all the flexibility one would need in practice. Thoughts? Ludo’. diff --git a/doc/guix.texi b/doc/guix.texi index 94f8e5e481..67a5517911 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -37461,6 +37461,7 @@ services)}. * Shells: Shells Home Services. POSIX shells, Bash, Zsh. * Mcron: Mcron Home Service. Scheduled User's Job Execution. * Shepherd: Shepherd Home Service. Managing User's Daemons. +* Desktop: Desktop Home Services. Services for graphical environments. @end menu @c In addition to that Home Services can provide @@ -37848,6 +37849,75 @@ mechanism instead (@pxref{Shepherd Services}). @end table @end deftp +@node Desktop Home Services +@subsection Desktop Home Services + +The @code{(gnu home services desktop)} module provides services that you +may find useful on ``desktop'' systems running a graphical user +environment such as Xorg. + +@defvr {Scheme Variable} home-redshift-service-type +This is the service type for @uref{https://github.com/jonls/redshift, +Redshift}, a program that adjusts the display color temperature +according to the time of day. Its associated value must be a +@code{home-redshift-configuration} record, as shown below. + +A typical configuration, where we manually specify the latitude and +longitude, might look like this: + +@lisp +(service home-redshift-service-type + (home-redshift-configuration + (location-provider 'manual) + (latitude 35.81) ;northern hemisphere + (longitude -0.80))) ;west of Greenwich +@end lisp +@end defvr + +@deftp {Data Type} home-redshift-configuration +Available @code{home-redshift-configuration} fields are: + +@table @asis +@item @code{redshift} (default: @code{redshift}) (type: file-like) +Redshift package to use. + +@item @code{location-provider} (default: @code{geoclue2}) (type: symbol) +Geolocation provider---@code{'manual} or @code{'geoclue2}. In the +former case, you must also specify the @code{latitude} and +@code{longitude} fields so Redshift can determine daytime at your place. +In the latter case, the Geoclue system service must be running; it will +be queried for location information. + +@item @code{adjustment-method} (default: @code{randr}) (type: symbol) +Color adjustment method. + +@item @code{daytime-temperature} (default: @code{6500}) (type: integer) +Daytime color temperature (kelvins). + +@item @code{nighttime-temperature} (default: @code{4500}) (type: integer) +Nighttime color temperature (kelvins). + +@item @code{daytime-brightness} (default: @code{disabled}) (type: maybe-inexact-number) +Daytime screen brightness, between 0.1 and 1.0. + +@item @code{nighttime-brightness} (default: @code{disabled}) (type: maybe-inexact-number) +Nighttime screen brightness, between 0.1 and 1.0. + +@item @code{latitude} (default: @code{disabled}) (type: maybe-inexact-number) +Latitude, when @code{location-provider} is @code{'manual}. + +@item @code{longitude} (default: @code{disabled}) (type: maybe-inexact-number) +Longitude, when @code{location-provider} is @code{'manual}. + +@item @code{extra-content} (default: @code{""}) (type: raw-configuration-string) +Extra content appended as-is to the Redshift configuration file. Run +@command{man redshift} for more information about the configuration file +format. + +@end table + +@end deftp + @node Invoking guix home @section Invoking @code{guix home} diff --git a/gnu/home/services/desktop.scm b/gnu/home/services/desktop.scm new file mode 100644 index 0000000000..010668550a --- /dev/null +++ b/gnu/home/services/desktop.scm @@ -0,0 +1,158 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Ludovic Courtès +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu home services desktop) + #:use-module (gnu home services) + #:use-module (gnu home services shepherd) + #:use-module (gnu services configuration) + #:autoload (gnu packages xdisorg) (redshift) + #:use-module (guix records) + #:use-module (guix gexp) + #:use-module (srfi srfi-1) + #:use-module (ice-9 match) + #:export (home-redshift-configuration + home-redshift-configuration? + + home-redshift-service-type)) + + +;;; +;;; Redshift. +;;; + +(define (serialize-integer field value) + (string-append (match field + ('daytime-temperature "temp-day") + ('nighttime-temperature "temp-night") + ('daytime-brightness "brightness-day") + ('nighttime-brightness "brightness-night") + ('latitude "lat") + ('longitude "lon") + (_ (symbol->string field))) + "=" (number->string value) "\n")) + +(define (serialize-symbol field value) + (string-append (symbol->string field) + "=" (symbol->string value) "\n")) + +(define serialize-inexact-number serialize-integer) + +(define (inexact-number? n) + (and (number? n) (inexact? n))) +(define-maybe inexact-number) + +(define (serialize-raw-configuration-string field value) + value) +(define raw-configuration-string? string?) + +(define-configuration home-redshift-configuration + (redshift + (file-like redshift) + "Redshift package to use.") + + (location-provider + (symbol 'geoclue2) + "Geolocation provider---@code{'manual} or @code{'geoclue2}. + +In the former case, you must also specify the @code{latitude} and +@code{longitude} fields so Redshift can determine daytime at your place. In +the latter case, the Geoclue system service must be running; it will be +queried for location information.") + (adjustment-method + (symbol 'randr) + "Color adjustment method.") + + ;; Default values from redshift(1). + (daytime-temperature + (integer 6500) + "Daytime color temperature (kelvins).") + (nighttime-temperature + (integer 4500) + "Nighttime color temperature (kelvins).") + + (daytime-brightness + (maybe-inexact-number 'disabled) + "Daytime screen brightness, between 0.1 and 1.0.") + (nighttime-brightness + (maybe-inexact-number 'disabled) + "Nighttime screen brightness, between 0.1 and 1.0.") + + (latitude + (maybe-inexact-number 'disabled) + "Latitude, when @code{location-provider} is @code{'manual}.") + (longitude + (maybe-inexact-number 'disabled) + "Longitude, when @code{location-provider} is @code{'manual}.") + + (extra-content + (raw-configuration-string "") + "Extra content appended as-is to the Redshift configuration file. Run +@command{man redshift} for more information about the configuration file +format.")) + +(define (serialize-redshift-configuration config) + (define location-fields + '(latitude longitude)) + + (define (location-field? field) + (memq (configuration-field-name field) location-fields)) + + (define (secondary-field? field) + (or (location-field? field) + (memq (configuration-field-name field) + '(redshift extra-content)))) + + #~(string-append + "[redshift]\n" + #$(serialize-configuration config + (remove secondary-field? + home-redshift-configuration-fields)) + "\n[manual]\n" + #$(serialize-configuration config + (filter location-field? + home-redshift-configuration-fields)) + + #$(home-redshift-configuration-extra-content config))) + +(define (redshift-shepherd-service config) + (define config-file + (computed-file "redshift.conf" + #~(call-with-output-file #$output + (lambda (port) + (display #$(serialize-redshift-configuration config) + port))))) + + (list (shepherd-service + (documentation "Redshift program.") + (provision '(redshift)) + ;; FIXME: This fails to start if Home is first activated from a + ;; non-X11 session. + (start #~(make-forkexec-constructor + (list #$(file-append redshift "/bin/redshift") + "-c" #$config-file))) + (stop #~(make-kill-destructor))))) + +(define home-redshift-service-type + (service-type + (name 'home-redshift) + (extensions (list (service-extension home-shepherd-service-type + redshift-shepherd-service))) + (default-value (home-redshift-configuration)) + (description + "Run Redshift, a program that adjusts the color temperature of display +according to time of day."))) diff --git a/gnu/local.mk b/gnu/local.mk index 27e7877361..80cb760132 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -79,6 +79,7 @@ GNU_SYSTEM_MODULES = \ %D%/ci.scm \ %D%/home.scm \ %D%/home/services.scm \ + %D%/home/services/desktop.scm \ %D%/home/services/symlink-manager.scm \ %D%/home/services/fontutils.scm \ %D%/home/services/shells.scm \ base-commit: 27c1d58d901dcf48929bcb6f76d861fc21575dbf -- 2.34.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 30 12:43:35 2022 Received: (at 53466) by debbugs.gnu.org; 30 Jan 2022 17:43:35 +0000 Received: from localhost ([127.0.0.1]:37568 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEEEh-0000wn-4M for submit@debbugs.gnu.org; Sun, 30 Jan 2022 12:43:35 -0500 Received: from andre.telenet-ops.be ([195.130.132.53]:47710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEEEd-0000wa-9w for 53466@debbugs.gnu.org; Sun, 30 Jan 2022 12:43:33 -0500 Received: from [172.20.10.5] ([5.23.227.239]) by andre.telenet-ops.be with bizsmtp id p5jU260025AYamV015jUcG; Sun, 30 Jan 2022 18:43:29 +0100 Message-ID: <091b93b3f04fe083d9fd0b798523a272fb623ce4.camel@telenet.be> Subject: Re: [bug#53466] [PATCH v2] home: Add redshift service. From: Maxime Devos To: Ludovic =?ISO-8859-1?Q?Court=E8s?= , 53466@debbugs.gnu.org Date: Sun, 30 Jan 2022 18:43:18 +0100 In-Reply-To: <20220130151139.3857-1-ludo@gnu.org> References: <87sft8tah0.fsf@trop.in> <20220130151139.3857-1-ludo@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-fTGBZZcMiop5eUUkWk6i" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1643564609; bh=2OJQDojPFahnRANyFcHD7mw5t/gnFk1iBdqd8l3+TAs=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=EUMN3DrMlY/QxuZ4g81tRCG+BZPgcWwZruq4m9cf8rQIKUSHHYxvU3nC/XaxXRRqd DfN+V6rhzK3euT0HSXG/h4Z04N2o0evAS+DKl9tymAZfrn+Tnq/LX5qeGRg0rNY3mR li5yakgIo9d7wZtElUeTlCvVx2Q/YvouO230verpIQ3WtU4GEi7IefBKl4FbXcDKWs yADv32P8FvqM7vHQA8cq1X+WpkmXZPfYJVgrOTx6QlVKnaYgPT2q9DIy/WfoxzIr8h +QJq6Rj40N9qkVJlDw+cWtE5IDgZAZDG/ZPhltL0cmuIX8gvGKHFo5DKYgIONmVbL5 TaCR8ZYfL7ocw== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 53466 Cc: Andrew Tropin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-fTGBZZcMiop5eUUkWk6i Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s schreef op zo 30-01-2022 om 16:11 [+0100]: > +@item @code{location-provider} (default: @code{geoclue2}) (type: symbol) > +Geolocation provider---@code{'manual} or @code{'geoclue2}.=C2=A0 In the > +former case, you must also specify the @code{latitude} and > +@code{longitude} fields so Redshift can determine daytime at your place. > +In the latter case, the Geoclue system service must be running; it will > +be queried for location information. > + > +@item @code{adjustment-method} (default: @code{randr}) (type: symbol) > +Color adjustment method. It would be nice to document which color adjustment methods exist, as done for 'location-provider'. Greetings, Maxime --=-fTGBZZcMiop5eUUkWk6i Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYfbONhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7syaAP0evH3AXhY4m9QxzjfKbyRyCBpD oY38ZNmgdnQQO7lHiAD/cc3kNgzSSAm/9sHWYgiSa9D+8QdCg/vrSFHDH9B2IgY= =BKLN -----END PGP SIGNATURE----- --=-fTGBZZcMiop5eUUkWk6i-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 31 13:22:17 2022 Received: (at 53466) by debbugs.gnu.org; 31 Jan 2022 18:22:17 +0000 Received: from localhost ([127.0.0.1]:40725 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEbJh-0004ys-1F for submit@debbugs.gnu.org; Mon, 31 Jan 2022 13:22:17 -0500 Received: from mail-lf1-f51.google.com ([209.85.167.51]:39793) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEbJe-0004yd-Il for 53466@debbugs.gnu.org; Mon, 31 Jan 2022 13:22:15 -0500 Received: by mail-lf1-f51.google.com with SMTP id b9so28626630lfq.6 for <53466@debbugs.gnu.org>; Mon, 31 Jan 2022 10:22:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=HTwOlEQc2lRtLf8REB61DpJnATvved7S7BtNaE1JBg0=; b=m4nPoP7kN39d1rCp24i9RmOByolYPLCY48xmwMf4PtHz7RApC3JhOZjFZKfdmY+a4q qwGtDTAdNj7yV7l8wGeLTFR0Xiv44nd6Bewe9dEKUGMx6xaLNaOLJyNbteUM3yqs0LjQ Cr7KT/NqA3Kwq8ptMYLGZMOI5dBtNomApCenGJ3faVaoj38SQLUiCptFkGFDnBBtXTqZ U1blr/G5z8lE7Jk830UQc+b7A2KMkpERtEMFaGapusgf2l5Pvsy9GdjHDSPPcJilUb/l SyXFlH+fnYrzvIA6KhINB1xuymFK65tuy2BxeRgwlru2uGX6MAah9eacPSzb7ATm2LQP F3eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=HTwOlEQc2lRtLf8REB61DpJnATvved7S7BtNaE1JBg0=; b=yNCI0GJrrMnuQWg+DqdEPJ8oaIk+ehUilfooqvOumLDGXFXiaq7pZ0n1NTS5rELuwC qibeYcbOmHh1bTzqoX00Y+r6/xMtwQzMTbKdSaOrUrkBlFR74wFIPNcUgeIGXNkXCZOU +OTx3799gz4/UMXFEERG7sWVdbYdDnP90x+sU4lfAfbTA/XkZA9EBJumJLPaJ7lqPdP6 AvpkD0ovaQL+S4nZuCPtXWhBxkuygr+BprEaPAT0Vo9p/HZ+/8VkgdpGSjQ5Y1BU7kKJ YeUxyPLGeRSUpXwFSRRF7cqwESjy/vL8b7irVihm3whAYSF/S6GJKxMyMfNeHHKy6UEV gV1g== X-Gm-Message-State: AOAM531Noty0mn9mNjZNgKojSMajTLfssOP1mvzSvQEqLS5Lc5Cwhu0q j8mfIdZNaeI0Y7x+o88UoFjIirJSs7JRRw== X-Google-Smtp-Source: ABdhPJxYEx86iMTqPK8EEMcpLVRIqPDH0M4/eN6pu4F4iknETKxde+4/AOd8+Eg56jz0SPd3THfcrA== X-Received: by 2002:ac2:58c5:: with SMTP id u5mr17001798lfo.186.1643653328286; Mon, 31 Jan 2022 10:22:08 -0800 (PST) Received: from localhost (109-252-135-33.dynamic.spd-mgts.ru. [109.252.135.33]) by smtp.gmail.com with ESMTPSA id e24sm457903ljj.131.2022.01.31.10.22.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 10:22:07 -0800 (PST) From: Andrew Tropin To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#53466] [PATCH] home: Add redshift service. In-Reply-To: <87zgnfbtao.fsf@gnu.org> References: <20220123111159.27020-1-ludo@gnu.org> <87sft8tah0.fsf@trop.in> <87zgnfbtao.fsf@gnu.org> Date: Mon, 31 Jan 2022 21:22:04 +0300 Message-ID: <87v8xzyddf.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53466 Cc: 53466@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-01-28 19:37, Ludovic Court=C3=A8s wrote: > Hi Andrew, > > Andrew Tropin skribis: > >> On 2022-01-23 12:11, Ludovic Court=C3=A8s wrote: >> >>> * gnu/home/services/desktop.scm: New file. >>> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. >>> * doc/guix.texi (Desktop Home Services): New node. > > [...] > >>> +(define-configuration home-redshift-configuration >> >> (redshift >> (package redshift)) >> >> would be useful, especially for people who would like to use a patched >> redshift supporting wayland or some other extended version of a package. > > Oops, indeed; I=E2=80=99ll add it. > Good, thank you. >> Another good candidate for a separate field is shepherd? or >> shepherd-service? to make it possible to remove an integration with >> shepherd if it's not needed. > > What would the service do when set to #f? > Only add a package to profile and configuration to home-files. >>> + (latitude >>> + (maybe-inexact-number 'disabled) >>> + "Latitude, when @code{location-provider} is @code{'manual}.") >>> + (longitude >>> + (maybe-inexact-number 'disabled) >>> + "Longitude, when @code{location-provider} is @code{'manual}.")) >> >> While I like the naming of the fields more than original option names I >> still not a big fan of this approach for various reasons: > > For the record, the whole project avoids abbreviations. I think it=E2=80= =99s an > important part of making things intelligible, especially to non-native > speakers. > It's really cool.=20 >> 1. Users of this home service would need to deal with one more level >> of abstraction and keep in mind latitude -> manual.lat, >> nighttime-brightness -> redshift.brightness-night, etc mappings. >> Maybe for completely new users it's not even necessary to think about >> internals, but for person reading man pages or non-guix specific >> articles it would be a headache. It's not that bad for very simple >> programs like redshift, but becomes much more significant for >> software supporting much more options like sway or git. > > Yes, that=E2=80=99s the usual tradeoff. The choice made so far in Guix h= as been > to choose clarity over faithfulness to upstream=E2=80=99s 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. >> 2. With the current configuration implementation 8 options are missing >> and not possible to set, also it's not possible to reuse already >> existing configuration. > > Oops yes, I=E2=80=99ll add an escape hatch. > >> Escape hatch with extra-content field solves this problem only >> partially and extra-content can NOT be combined with the rest of >> fields representing redshift options. So it should be a named a >> "file", not extra-content, and when used will remove the effect of all >> other fields. extra-options is possible but will blow the mind, we >> have mappings and all that stuff, also need a custom serialization >> logic to merge sections. > > I=E2=80=99ll look into it, and I think that=E2=80=99ll help me understand= why this > file-like vs. string is so important to you. > I'll make another reply to the second version of the patch and highlight this topic a little. >> 3. We copy the documentation and part of implementation for software we >> are wrapping and now we have to maintain it ourselves. Probably, >> redshift is quite stable and both documentation and options doesn't >> change frequently, but for the bigger projects it will lead to outdated >> docs and missing options quite fast or will put a huge maintanance >> burden. > > Yes. Again, that=E2=80=99s the choice we made in Guix: providing binding= s for > config file formats. It=E2=80=99s ambitious, but it=E2=80=99s worked wel= l so far. If > it worked for the Dovecot, surely it won=E2=80=99t be a problem here. :-) > >> 4. If we decide one day to continue development of guix home import >> command it would be a little nightmare to write importers from existing >> configuration to guix services configurations. > > I view =E2=80=98guix home import=E2=80=99 as a helper, like =E2=80=98guix= import=E2=80=99. I don=E2=80=99t > think it would make sense to have it automatically handle all the config > files that could possibly be handled by Guix Home services. > I treat it the same, I forgot to add that guix home import is just an example, any generation of configurations or other automated processing becomes magnitudes harder. Even including sophisticated "type checks". >> I would prefer to have one config field for all the fields above: >> >> (redshift-conf >> '((redshift >> ((temp-day . 5700) >> (temp-night . 3600) >> (gamma . 0.8) >> ;; any other number of option some one would like to set >> #~"dawn-time=3D6:00\ndusk-time=3D18:00" >> ;; or a nasty slurp-file-gexp, which reads the existing >> ;; configuration or part of it if we migrate step by step >> (adjustment-method . randr) >> (location-provider . manual))) >> (manual >> ((lat . 55.7) >> (lon . 12.6))))) > > 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. However, the big pros of guix records, that it's already have some whistles and bells. > > [...] > >>> + (list (shepherd-service >>> + (documentation "Redshift program.") >>> + (provision '(redshift)) >>> + (start #~(make-forkexec-constructor >> >> There is a possibility that shepherd is launched before X or wayland >> session started and redshift won't be able to access necessary >> environment variables. I have a few hacky solutions for other >> applications, but need to come up with a better and more generic way to >> handle it. > > Oh, I see. I=E2=80=99ll add a FIXME. In practice, that problem would ma= nifest > only if someone logs in at the console first, right? Mostly yes. > > Perhaps we could define a pseudo =E2=80=98xserver-xorg=E2=80=99 Shepherd = service that > would be down when =E2=80=98DISPLAY=E2=80=99 is undefined, or something l= ike that? > It's only a part of the puzzle, we also need somehow to make this service to share environment variables with other services, when X window manager or Wayland compositor is finally started. >>> + (list #$(file-append redshift "/bin/redshift") >>> + "-c" #$config-file))) >>> + (stop #~(make-kill-destructor))))) >>> + >>> +(define home-redshift-service-type >>> + (service-type >>> + (name 'home-redshift) >>> + (extensions (list (service-extension home-shepherd-service-type >>> + redshift-shepherd-service))) >> >> 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=E2=80=99s not something we usually do for syst= em > services. Imagine terminal or almost any other user space program, which doesn't have a configuration in ~/.config and binary in the profile. Many of home services will require both to make underlying programs operate correctly (also think about setting search paths and similar things). I can imagine some exceptions, but better to keep it consistent and do it for all home services not to confuse people. > > As for the latter, I thought about it but I=E2=80=99m not sure what it wo= uld 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). >> This way user will be able to launch redshift himself or using other >> mechanism like wm startup file, it maybe necessary for >> testing/debugging purpose or to be sure that redshift has DISPLAY or >> other variables available or maybe some other use cases. > > In that case it may be best to let users explicitly install it in their > profile maybe? > I think for home services it's ok to always add a package to profile. >> Yes, it's possible to use the approach proposed by this patch for >> implementing configuration for such simple program, but I still have >> a lot of concerns about applying it to more complex software. > > I understand your concerns, but I think they=E2=80=99re beyond the scope = of this > review. I also think that there=E2=80=99s ample experience with system s= ervices > showing that writing =E2=80=9Cnice=E2=80=9D configuration bindings actual= ly 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 same mistake again knowing the consequences. Maybe I'm wrong. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmH4KMwPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wOScP/RBunPiNfqji6oce3hvTX0AkZVGYhRUyCMAT hypEFi1v4bg+W8UoxH3QotA4kugOphk7AIX3XQGMGyiXS1g/2mITNAnwUrzbDEro UZCd9fFLzwtnw70wV0jXNELfISf003as1HVXD2G62mk9dduSHyxu3PILAN9oixSu 2G1UEsEwIE4sKJoBsx5F5m1hC4g+Nh7fX4dHw6OojgpFymyPlDM0XqJ/H8kf2Ruo aE9oqEKunUZ8UyUjbBSNtCcRNRI5VfOhLEZvdRn0XqgqWbnbEAZbxVumUJsvKxIE 7H2L32S8vJQjC0bP+7uUzXbczzCPXIv9ck1QIRkoqxT2BIxgpzYgrENzVqBhWnge VwZPst838u8ofM5oC98b6gRvTzMUieHRPIDDj0EtFdK3KF2+EpBMik1bhc23PSxa eruWa9FnPwIZUBxQ5YHTAY2Jol7mZvLvTuTuUdHy2SDD9O4xfk1HCTB47G/nO601 j/KXhnnRxO1GHZ82xIzM98rnmMLAafX/nQ026RsRle65De7Q2MPZ2/HxeTsnuJQr G7q1EPnnIrjQrIiDo2cyZ11Ht+rOUtXr7ZOKQwEMphoGpx7GYWsu3t5xNkKlELd8 Xo4jXq8LCTDKinzVSoP7dWQPf5/CXTUcBVAUSS92a1uEiWXsscjtZa1H8RI7nc71 8qldywFR =LGT9 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 31 13:58:06 2022 Received: (at 53466) by debbugs.gnu.org; 31 Jan 2022 18:58:06 +0000 Received: from localhost ([127.0.0.1]:40803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEbsL-00068l-Eq for submit@debbugs.gnu.org; Mon, 31 Jan 2022 13:58:06 -0500 Received: from mail-lf1-f42.google.com ([209.85.167.42]:40733) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEbs4-000675-Ox for 53466@debbugs.gnu.org; Mon, 31 Jan 2022 13:58:04 -0500 Received: by mail-lf1-f42.google.com with SMTP id a28so28814946lfl.7 for <53466@debbugs.gnu.org>; Mon, 31 Jan 2022 10:57:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=ddAFKAJ/ZZMPZGgX2eNEtUjJfNdzPea68GcYZgIOhXQ=; b=wIKtgBWcjveExzLgWcNHXRu4XhjzzGpxmLQ2k79m94gU8RxYLppSzwIyQRBQeQG7RO 4P6PV9jygXVI4Y/TjT4JNac76zCqUns0Cb14mgRbEHz6lHmxOj4AN5INKGVvi/NOwCJs yUP+wfhf79y4498mnyvEBkI07TH+M8hcxgnggDmmGxIsC235XTxtMAPr9Nqac2AMiBUl BWagPQ3NFOGmK4YsoZIwBnSU5jdMeVsOkKJYBITd197kO1/YZ0J9ImLbL2m20KEv3ku2 dsZpYzYmSJZTYs+vtf7Tbf0j1+0NeUOS1zZJswRuhxlkt74f51m5txxixvLvCoJbkWzp 1afw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=ddAFKAJ/ZZMPZGgX2eNEtUjJfNdzPea68GcYZgIOhXQ=; b=U0Lr743yyRq5yLaKQovxX6h++V/gejgDcT7MMtAVND4RZ4KRcFRWJrME/yxRPh80mL JWrf4k2EaWxkYJ9NIN41vk0C9KC2nnOyuSEhYwlN3KF3tX8JByULTo4ZkoQTI2R89lYQ 5TJGnuWzEVAJ2zyH14W16P50hS270xpQBdvLi3fYJ43IcOBTs0/czczE1gadYRlQq9Ka oW77owfSmPkVwrgoG6iAePLIsewqEJ8Xj32zFEfADqfI+KzJYO7wXD2c9PCjeT4K0ty0 pxz/jdpQFWd0IbcLimcGfhBx/tUF70UkbskdYfA5Cz3FbfS2CvIX0pK/Sr6e9OAWHLrk V00A== X-Gm-Message-State: AOAM532Py+M36/7qwhjvM8fftHmNmM3mpyAlQpufXiDo/s2cZxMYqTC6 6LORdnCtaar2ME3DekkyrBWDMg== X-Google-Smtp-Source: ABdhPJzs6av0GdxM88zKcdg3LyB+FkduoYz0bZPr+M91xEA+5j1DEuDoZKAkk+hqEDW6tuCfzm8K/w== X-Received: by 2002:a19:fc08:: with SMTP id a8mr16393855lfi.340.1643655462253; Mon, 31 Jan 2022 10:57:42 -0800 (PST) Received: from localhost (109-252-135-33.dynamic.spd-mgts.ru. [109.252.135.33]) by smtp.gmail.com with ESMTPSA id r22sm1589873ljh.28.2022.01.31.10.57.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jan 2022 10:57:41 -0800 (PST) From: Andrew Tropin To: Ludovic =?utf-8?Q?Court=C3=A8s?= , 53466@debbugs.gnu.org Subject: Re: [bug#53466] [PATCH v2] home: Add redshift service. In-Reply-To: <20220130151139.3857-1-ludo@gnu.org> References: <87sft8tah0.fsf@trop.in> <20220130151139.3857-1-ludo@gnu.org> Date: Mon, 31 Jan 2022 21:57:38 +0300 Message-ID: <87r18nybq5.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53466 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-01-30 16:11, Ludovic Court=C3=A8s wrote: > * gnu/home/services/desktop.scm: New file. > * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. > * doc/guix.texi (Desktop Home Services): New node. > --- > doc/guix.texi | 70 +++++++++++++++ > gnu/home/services/desktop.scm | 158 ++++++++++++++++++++++++++++++++++ > gnu/local.mk | 1 + > 3 files changed, 229 insertions(+) > create mode 100644 gnu/home/services/desktop.scm > > Hello! > > Changes compared to v1 account for Andrew=E2=80=99s suggestions: > > =E2=80=A2 add =E2=80=98redshift=E2=80=99 field to specify the package t= o use; > > =E2=80=A2 add =E2=80=98extra-content=E2=80=99 field as an escape hatch. > > We could debate about the latter; from a pragmatic standpoint, > I think it gives all the flexibility one would need in practice. > > Thoughts? Probably, I already mentioned, but combining renamed option names from the configuration record and option names in the escape hatch is inconsistent, confusing and error-prone. > > Ludo=E2=80=99. > > diff --git a/doc/guix.texi b/doc/guix.texi > index 94f8e5e481..67a5517911 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -37461,6 +37461,7 @@ services)}. > * Shells: Shells Home Services. POSIX shells, Bash, Zsh. > * Mcron: Mcron Home Service. Scheduled User's Job Execution. > * Shepherd: Shepherd Home Service. Managing User's Daemons. > +* Desktop: Desktop Home Services. Services for graphical environm= ents. > @end menu > @c In addition to that Home Services can provide >=20=20 > @@ -37848,6 +37849,75 @@ mechanism instead (@pxref{Shepherd Services}). > @end table > @end deftp >=20=20 > +@node Desktop Home Services > +@subsection Desktop Home Services > + > +The @code{(gnu home services desktop)} module provides services that you > +may find useful on ``desktop'' systems running a graphical user > +environment such as Xorg. > + > +@defvr {Scheme Variable} home-redshift-service-type > +This is the service type for @uref{https://github.com/jonls/redshift, > +Redshift}, a program that adjusts the display color temperature > +according to the time of day. Its associated value must be a > +@code{home-redshift-configuration} record, as shown below. > + > +A typical configuration, where we manually specify the latitude and > +longitude, might look like this: > + > +@lisp > +(service home-redshift-service-type > + (home-redshift-configuration > + (location-provider 'manual) > + (latitude 35.81) ;northern hemisphere > + (longitude -0.80))) ;west of Greenwich > +@end lisp > +@end defvr > + > +@deftp {Data Type} home-redshift-configuration > +Available @code{home-redshift-configuration} fields are: > + > +@table @asis > +@item @code{redshift} (default: @code{redshift}) (type: file-like) > +Redshift package to use. > + > +@item @code{location-provider} (default: @code{geoclue2}) (type: symbol) > +Geolocation provider---@code{'manual} or @code{'geoclue2}. In the > +former case, you must also specify the @code{latitude} and > +@code{longitude} fields so Redshift can determine daytime at your place. > +In the latter case, the Geoclue system service must be running; it will > +be queried for location information. > + > +@item @code{adjustment-method} (default: @code{randr}) (type: symbol) > +Color adjustment method. > + > +@item @code{daytime-temperature} (default: @code{6500}) (type: integer) > +Daytime color temperature (kelvins). > + > +@item @code{nighttime-temperature} (default: @code{4500}) (type: integer) > +Nighttime color temperature (kelvins). > + > +@item @code{daytime-brightness} (default: @code{disabled}) (type: maybe-= inexact-number) > +Daytime screen brightness, between 0.1 and 1.0. > + > +@item @code{nighttime-brightness} (default: @code{disabled}) (type: mayb= e-inexact-number) > +Nighttime screen brightness, between 0.1 and 1.0. > + > +@item @code{latitude} (default: @code{disabled}) (type: maybe-inexact-nu= mber) > +Latitude, when @code{location-provider} is @code{'manual}. > + > +@item @code{longitude} (default: @code{disabled}) (type: maybe-inexact-n= umber) > +Longitude, when @code{location-provider} is @code{'manual}. > + > +@item @code{extra-content} (default: @code{""}) (type: raw-configuration= -string) > +Extra content appended as-is to the Redshift configuration file. Run > +@command{man redshift} for more information about the configuration file > +format. > + > +@end table > + > +@end deftp > + > @node Invoking guix home > @section Invoking @code{guix home} >=20=20 > diff --git a/gnu/home/services/desktop.scm b/gnu/home/services/desktop.scm > new file mode 100644 > index 0000000000..010668550a > --- /dev/null > +++ b/gnu/home/services/desktop.scm > @@ -0,0 +1,158 @@ > +;;; GNU Guix --- Functional package management for GNU > +;;; Copyright =C2=A9 2022 Ludovic Court=C3=A8s > +;;; > +;;; This file is part of GNU Guix. > +;;; > +;;; GNU Guix is free software; you can redistribute it and/or modify it > +;;; under the terms of the GNU General Public License as published by > +;;; the Free Software Foundation; either version 3 of the License, or (at > +;;; your option) any later version. > +;;; > +;;; GNU Guix is distributed in the hope that it will be useful, but > +;;; WITHOUT ANY WARRANTY; without even the implied warranty of > +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +;;; GNU General Public License for more details. > +;;; > +;;; You should have received a copy of the GNU General Public License > +;;; along with GNU Guix. If not, see . > + > +(define-module (gnu home services desktop) > + #:use-module (gnu home services) > + #:use-module (gnu home services shepherd) > + #:use-module (gnu services configuration) > + #:autoload (gnu packages xdisorg) (redshift) > + #:use-module (guix records) > + #:use-module (guix gexp) > + #:use-module (srfi srfi-1) > + #:use-module (ice-9 match) > + #:export (home-redshift-configuration > + home-redshift-configuration? > + > + home-redshift-service-type)) > + > + > +;;; > +;;; Redshift. > +;;; > + > +(define (serialize-integer field value) > + (string-append (match field > + ('daytime-temperature "temp-day") > + ('nighttime-temperature "temp-night") > + ('daytime-brightness "brightness-day") > + ('nighttime-brightness "brightness-night") > + ('latitude "lat") > + ('longitude "lon") > + (_ (symbol->string field))) > + "=3D" (number->string value) "\n")) > + > +(define (serialize-symbol field value) > + (string-append (symbol->string field) > + "=3D" (symbol->string value) "\n")) > + > +(define serialize-inexact-number serialize-integer) > + > +(define (inexact-number? n) > + (and (number? n) (inexact? n))) > +(define-maybe inexact-number) > + > +(define (serialize-raw-configuration-string field value) > + value) > +(define raw-configuration-string? string?) > + > +(define-configuration home-redshift-configuration > + (redshift > + (file-like redshift) > + "Redshift package to use.") > + > + (location-provider > + (symbol 'geoclue2) > + "Geolocation provider---@code{'manual} or @code{'geoclue2}. > + > +In the former case, you must also specify the @code{latitude} and > +@code{longitude} fields so Redshift can determine daytime at your place.= In > +the latter case, the Geoclue system service must be running; it will be > +queried for location information.") > + (adjustment-method > + (symbol 'randr) > + "Color adjustment method.") > + > + ;; Default values from redshift(1). > + (daytime-temperature > + (integer 6500) > + "Daytime color temperature (kelvins).") > + (nighttime-temperature > + (integer 4500) > + "Nighttime color temperature (kelvins).") > + > + (daytime-brightness > + (maybe-inexact-number 'disabled) > + "Daytime screen brightness, between 0.1 and 1.0.") > + (nighttime-brightness > + (maybe-inexact-number 'disabled) > + "Nighttime screen brightness, between 0.1 and 1.0.") > + > + (latitude > + (maybe-inexact-number 'disabled) > + "Latitude, when @code{location-provider} is @code{'manual}.") > + (longitude > + (maybe-inexact-number 'disabled) > + "Longitude, when @code{location-provider} is @code{'manual}.") > + > + (extra-content > + (raw-configuration-string "") > + "Extra content appended as-is to the Redshift configuration file. Run > +@command{man redshift} for more information about the configuration file > +format.")) > + > +(define (serialize-redshift-configuration config) > + (define location-fields > + '(latitude longitude)) > + > + (define (location-field? field) > + (memq (configuration-field-name field) location-fields)) > + > + (define (secondary-field? field) > + (or (location-field? field) > + (memq (configuration-field-name field) > + '(redshift extra-content)))) > + > + #~(string-append > + "[redshift]\n" > + #$(serialize-configuration config > + (remove secondary-field? > + home-redshift-configuration-fiel= ds)) > + "\n[manual]\n" > + #$(serialize-configuration config > + (filter location-field? > + home-redshift-configuration-fiel= ds)) > + It's very unclear where this extra-content goes and user can't know it until he check out the implementation or build the config (currently it's also almost impossible to find it on file system after build). Using such type of escape hatch is no joy at all. Seems this one is missplaced and should be go before [manual] section, otherwise it won't be possible to set values of redshift section. And doing so will lead to very ugly: (extra-content "\ dawn-time=3D5:30 dusk-time=3D18:30 [geoclue2] some-other-option=3Dvalue # Do I know that I'm in the middle of config file?") It will be especially ugly or even erroneous, when the target config has a format, which uses identation. I didn't try it for redshift, but in many ini parser it's forbidden to repeat sections with the same name. >=20 > + #$(home-redshift-configuration-extra-content config))) A little offtopic: I know a number of system services, where the extra-content goes in unexpected locations and overall behavior of escape hatch is unexpected and incosistent with other escape hatches. Some of the services has a number of escape hatches in almost every nested record with different names and behaviors. I'm relatively fresh Guix user and this part really confused me at first even having experience with NixOS module system before and it's very likely that many people just don't report it, because it really hard to get the roots of it. > + > +(define (redshift-shepherd-service config) > + (define config-file > + (computed-file "redshift.conf" > + #~(call-with-output-file #$output > + (lambda (port) > + (display #$(serialize-redshift-configuration co= nfig) > + port))))) > + > + (list (shepherd-service > + (documentation "Redshift program.") > + (provision '(redshift)) > + ;; FIXME: This fails to start if Home is first activated from a > + ;; non-X11 session. > + (start #~(make-forkexec-constructor > + (list #$(file-append redshift "/bin/redshift") > + "-c" #$config-file))) > + (stop #~(make-kill-destructor))))) > + > +(define home-redshift-service-type > + (service-type > + (name 'home-redshift) > + (extensions (list (service-extension home-shepherd-service-type > + redshift-shepherd-service))) > + (default-value (home-redshift-configuration)) > + (description > + "Run Redshift, a program that adjusts the color temperature of displ= ay > +according to time of day."))) > diff --git a/gnu/local.mk b/gnu/local.mk > index 27e7877361..80cb760132 100644 > --- a/gnu/local.mk > +++ b/gnu/local.mk > @@ -79,6 +79,7 @@ GNU_SYSTEM_MODULES =3D \ > %D%/ci.scm \ > %D%/home.scm \ > %D%/home/services.scm \ > + %D%/home/services/desktop.scm \ > %D%/home/services/symlink-manager.scm \ > %D%/home/services/fontutils.scm \ > %D%/home/services/shells.scm \ > > base-commit: 27c1d58d901dcf48929bcb6f76d861fc21575dbf =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmH4MSIPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wQMoP/iqMv0dgHlIYxUWp4n+v9R2140n8QQhr+GFU R7zEyznIfs3LKWd5WH1UhUAhTNWZ8NPJlIjdTj14Pawpvu4CL8ZkTS+ISE44VJ7z dY/ApOYr/oK/X/ODg2xKF4bDGOFefR8TIjTcUtYJoHA4ElmXD3us4vtsjcpAgVAw AQap2bzKr70QJ169dZ4Iq4gzJqBbUq1uwn3pBXG5CkTraVJyR09EnoeRyEL3wUTh iBMobOQR2EULK42ya5oXPvgmUo5GUHVB9LbaPwLUlKPqeyNjnUYxL52lisRBn8O6 n8izHY1NMZyr0AT2PcVgxljm4XRwLaOGH6KV2eAWycYBc6J8rrT9y0KO6X6ciJoq CNxKVKfdrqvFQP/CqdgqDCOFT1U2MxRnSfDXjPcQJ/3Evks2ZSvcpwx/Rx6lppG3 vRy2O5PsrGBQtTTq9BjqyjI7Kc6psufzTp7D2uzOBIY+O+spkRBk1zkGBGN1IC4t iTLZliipBQui47EOo/byCpDkm6Sg5jSUHdoX5pjfBZiICUfrmxFv4kHXqCPMGRcl mhzUXNa2rtel0WxTQTgIZAq9C5AS0TunYLjxnchhF1d2Q8SxV6bRCMvFRI0ftbgc fLO/ULW9VqGi8BTJa3Ah74wKgxDAZfAssvsAqfhCBAGG9vL0vh8XsqqJ2ikOIev7 9BfYs/oQ =T2To -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 03:36:44 2022 Received: (at 53466) by debbugs.gnu.org; 1 Feb 2022 08:36:44 +0000 Received: from localhost ([127.0.0.1]:41652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEoea-0004WW-76 for submit@debbugs.gnu.org; Tue, 01 Feb 2022 03:36:44 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:50962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEoeZ-0004WF-1Y for 53466@debbugs.gnu.org; Tue, 01 Feb 2022 03:36:43 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 87828365; Tue, 1 Feb 2022 09:36:37 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xKgnosWPjeuc; Tue, 1 Feb 2022 09:36:37 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id D03594A; Tue, 1 Feb 2022 09:36:36 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxime Devos Subject: Re: [bug#53466] [PATCH v2] home: Add redshift service. References: <87sft8tah0.fsf@trop.in> <20220130151139.3857-1-ludo@gnu.org> <091b93b3f04fe083d9fd0b798523a272fb623ce4.camel@telenet.be> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 13 =?utf-8?Q?Pluvi=C3=B4se?= an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 01 Feb 2022 09:36:36 +0100 In-Reply-To: <091b93b3f04fe083d9fd0b798523a272fb623ce4.camel@telenet.be> (Maxime Devos's message of "Sun, 30 Jan 2022 18:43:18 +0100") Message-ID: <87v8xz6l0r.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: 87828365 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 53466 Cc: 53466@debbugs.gnu.org, Andrew Tropin X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi, Maxime Devos skribis: > Ludovic Court=C3=A8s schreef op zo 30-01-2022 om 16:11 [+0100]: >> +@item @code{location-provider} (default: @code{geoclue2}) (type: symbol) >> +Geolocation provider---@code{'manual} or @code{'geoclue2}.=C2=A0 In the >> +former case, you must also specify the @code{latitude} and >> +@code{longitude} fields so Redshift can determine daytime at your place. >> +In the latter case, the Geoclue system service must be running; it will >> +be queried for location information. >> + >> +@item @code{adjustment-method} (default: @code{randr}) (type: symbol) >> +Color adjustment method. > > It would be nice to document which color adjustment methods exist, > as done for 'location-provider'. Good idea, will do. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 03:43:49 2022 Received: (at 53466) by debbugs.gnu.org; 1 Feb 2022 08:43:49 +0000 Received: from localhost ([127.0.0.1]:41660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEolR-0004ht-2s for submit@debbugs.gnu.org; Tue, 01 Feb 2022 03:43:49 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:51110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEolO-0004hf-Sh for 53466@debbugs.gnu.org; Tue, 01 Feb 2022 03:43:47 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id CD56E365; Tue, 1 Feb 2022 09:43:40 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Be9AVOKhUz4m; Tue, 1 Feb 2022 09:43:39 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 465F323C; Tue, 1 Feb 2022 09:43:39 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Andrew Tropin Subject: Re: [bug#53466] [PATCH v2] home: Add redshift service. References: <87sft8tah0.fsf@trop.in> <20220130151139.3857-1-ludo@gnu.org> <87r18nybq5.fsf@trop.in> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 13 =?utf-8?Q?Pluvi=C3=B4se?= an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 01 Feb 2022 09:43:38 +0100 In-Reply-To: <87r18nybq5.fsf@trop.in> (Andrew Tropin's message of "Mon, 31 Jan 2022 21:57:38 +0300") Message-ID: <87leyv6kp1.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: CD56E365 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 53466 Cc: 53466@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi, Andrew Tropin skribis: > On 2022-01-30 16:11, Ludovic Court=C3=A8s wrote: > >> * gnu/home/services/desktop.scm: New file. >> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. >> * doc/guix.texi (Desktop Home Services): New node. [...] > Probably, I already mentioned, but combining renamed option names from > the configuration record and option names in the escape hatch is > inconsistent, confusing and error-prone. I think I replied already. > It's very unclear where this extra-content goes and user can't know it > until he check out the implementation or build the config (currently > it's also almost impossible to find it on file system after build). (He or she.) I documented it in a way that I thought was clear: @item @code{extra-content} (default: @code{""}) (type: raw-configuration-= string) Extra content appended as-is to the Redshift configuration file. [=E2=80= =A6] Notice =E2=80=9Cappended=E2=80=9D. How would you phrase it? > Using such type of escape hatch is no joy at all. Escape hatches are meant to be used as a last resort; they=E2=80=99re a hac= k. Normally, people would have everything they need with the provided bindings. So yes, using them is no fun, but that=E2=80=99s not a surprise = IMO. > Seems this one is missplaced and should be go before [manual] section, > otherwise it won't be possible to set values of redshift section. And > doing so will lead to very ugly: > > (extra-content "\ > dawn-time=3D5:30 > dusk-time=3D18:30 > [geoclue2] > some-other-option=3Dvalue > # Do I know that I'm in the middle of config file?") > > It will be especially ugly or even erroneous, when the target config has > a format, which uses identation. > > I didn't try it for redshift, but in many ini parser it's forbidden to > repeat sections with the same name. Ah, bummer. Another way to see it is that I should augment the bindings, maybe that=E2=80=99s what you=E2=80=99re getting at? :-) I can do that. >> + #$(home-redshift-configuration-extra-content config))) > > A little offtopic: > > I know a number of system services, where the extra-content goes in > unexpected locations and overall behavior of escape hatch is unexpected > and incosistent with other escape hatches. Some of the services has a > number of escape hatches in almost every nested record with different > names and behaviors. > > I'm relatively fresh Guix user and this part really confused me at first > even having experience with NixOS module system before and it's very > likely that many people just don't report it, because it really hard to > get the roots of it. How does NixOS handle escape hatches today? Back when I was using it is that it wasn=E2=80=99t any more consistent than what we have today, which i= s at least a consolation. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 01 04:15:49 2022 Received: (at 53466) by debbugs.gnu.org; 1 Feb 2022 09:15:49 +0000 Received: from localhost ([127.0.0.1]:41691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEpGP-0007qY-8V for submit@debbugs.gnu.org; Tue, 01 Feb 2022 04:15:49 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:52024) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEpGM-0007qI-BC for 53466@debbugs.gnu.org; Tue, 01 Feb 2022 04:15:47 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id E1C2B13D; Tue, 1 Feb 2022 10:15:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rFgij8V-zs2z; Tue, 1 Feb 2022 10:15:39 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id A56AC4A; Tue, 1 Feb 2022 10:15:38 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Andrew Tropin Subject: Re: [bug#53466] [PATCH] home: Add redshift service. References: <20220123111159.27020-1-ludo@gnu.org> <87sft8tah0.fsf@trop.in> <87zgnfbtao.fsf@gnu.org> <87v8xzyddf.fsf@trop.in> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 13 =?utf-8?Q?Pluvi=C3=B4se?= an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 01 Feb 2022 10:15:38 +0100 In-Reply-To: <87v8xzyddf.fsf@trop.in> (Andrew Tropin's message of "Mon, 31 Jan 2022 21:22:04 +0300") Message-ID: <87v8xz54n9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: E1C2B13D X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 53466 Cc: 53466@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi Andrew, We=E2=80=99re drifting away from the practical issue of adding a Redshift service, but you raise interesting issues. Andrew Tropin skribis: [...] >> Yes, that=E2=80=99s the usual tradeoff. The choice made so far in Guix = has been >> to choose clarity over faithfulness to upstream=E2=80=99s 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=E2=80=99t have to be a single answer. For Redshift and= its handful of options, I see little incentive to go look at =E2=80=98man redsh= ift=E2=80=99; it doesn=E2=80=99t 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=E2=80=99m aware of Clojure specs, but I don=E2=80=99t find it convincing = compared to records, at least for our use case. [...] >>> 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=E2=80=99s not something we usually do for sys= tem >> services. > > Imagine terminal or almost any other user space program I=E2=80=99m not imagining: we=E2=80=99re discussing a very concrete service= here. :-) For Redshift, I don=E2=80=99t see the point of making the config available globally. For system services, there=E2=80=99s only a handful of exception= (PAM and OpenSSH come to mind, but see /etc). Again, there doesn=E2=80=99t have to be a single answer. I suspect many services won=E2=80=99t need to make their config available under ~/.config,= but if some do, so be it. I=E2=80=99d say that the default should be to not ma= ke config available unless that=E2=80=99s required, just like what we do for s= ystem services. How does that sound? >> As for the latter, I thought about it but I=E2=80=99m not sure what it w= ould 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 =E2=80=98redshift=E2=80=99 to the user prof= ile would be to allow =E2=80=98man redshift=E2=80=99. I don=E2=80=99t view it as super useful in this case, and would instead lea= n on the side of not =E2=80=9Cpolluting=E2=80=9D the user=E2=80=99s profile, but= I can very well imagine that in other cases we=E2=80=99d prefer to extend the user=E2=80=99= s profile. >> I understand your concerns, but I think they=E2=80=99re beyond the scope= of this >> review. I also think that there=E2=80=99s ample experience with system = services >> showing that writing =E2=80=9Cnice=E2=80=9D configuration bindings actua= lly 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. > same mistake again knowing the consequences. Maybe I'm wrong. Maybe one of us is wrong, or maybe it=E2=80=99s more complex than this. :-) As it turns out, I find Guix=E2=80=99s configuration records rather nice to use=E2=80=94much nicer than, for example, Gnus=E2=80=99 loose configuration= trees. Thanks for your feedback, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 02 01:59:24 2022 Received: (at 53466) by debbugs.gnu.org; 2 Feb 2022 06:59:24 +0000 Received: from localhost ([127.0.0.1]:51269 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nF9bw-0006OB-6s for submit@debbugs.gnu.org; Wed, 02 Feb 2022 01:59:24 -0500 Received: from mail-lj1-f170.google.com ([209.85.208.170]:33356) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nF9bt-0006Nw-Hj for 53466@debbugs.gnu.org; Wed, 02 Feb 2022 01:59:22 -0500 Received: by mail-lj1-f170.google.com with SMTP id bx31so15793923ljb.0 for <53466@debbugs.gnu.org>; Tue, 01 Feb 2022 22:59:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=6VMVI6BWUmFtCisI7OWsDNdRskjyYmYs6a0mPPukxz4=; b=m0SuCV6wjOdncqpsKlCYpvoDFnEi71BqfEQp8VowUUDUpiVdJK/yTQ8EzuRPFj/quF rC5zfaoKzRuX7zgxaZ7icNCol5x5jaLCFZLnhSYcTOHr738jnwLpYyfoUIEPnoNAxsRH mhUTmxz6wMCNfol5bSLTfw1WUJkis2jlNJNPw/+5KThtKjI2ObSoZ9g8PxtEsT/6xd8S ZyfvomVAfa97yaX18NlqKg3Q+QpgvmdyhiW3JwWh4HeZuQf/34cN3lu/VYOsha4PAxrB m4Jv32Zxhu59Iiye8m4amC8xkP5e8jWJnKfuWGECdmpR40hEF3+buWAs7BOLXrGoKuMa 0GHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=6VMVI6BWUmFtCisI7OWsDNdRskjyYmYs6a0mPPukxz4=; b=veq9UjZ9pniWb1Ak7eIxwIXpLHGQMk4WD/M+TmY8xPEmgF2wNrzBc51dk1uaJDF6gp Vlwon7UBp2rT9jNqpN7HspWfm64nO/rZStLSb/bWaNhxlrLcZjeel1SdCPuCyBoOKPQq /4ilBOASt6X/9/LE7icX1hfcTEmrSGwO/dDEHGJYSc71Obb7BziiYkTXXTlI9YUXlPzC dov0v22YwS3M3QdJVkOOkyDZVjciLXAozx4sm4r41nyiJEONROpVpNQ2TmipmtXMHKVa sF5otWkL8yY61WguuT2mEY7LeVo3TLNUECdMAhNKs/cUYFLQQt/dkH9cjLtDTc2Fg2i6 8XIg== X-Gm-Message-State: AOAM5328UV/c6t/6Hydl5H73vqLOl3psBMHJpO4RjBUvHcSKO8rij+7L PH95DwWFMG66wRPN8E+ccjheqQ03LALGig== X-Google-Smtp-Source: ABdhPJyLPhC1RB5HMhYWd/5hF/QjipJe+bTiwBwCcgfT8DIESgxqRoTsAD3jd2yLkHeJ7392YoDD7Q== X-Received: by 2002:a2e:9f41:: with SMTP id v1mr18805701ljk.154.1643785155200; Tue, 01 Feb 2022 22:59:15 -0800 (PST) Received: from localhost (109-252-135-33.dynamic.spd-mgts.ru. [109.252.135.33]) by smtp.gmail.com with ESMTPSA id p15sm3109499ljn.19.2022.02.01.22.59.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 22:59:14 -0800 (PST) From: Andrew Tropin To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#53466] [PATCH] home: Add redshift service. In-Reply-To: <87v8xz54n9.fsf@gnu.org> References: <20220123111159.27020-1-ludo@gnu.org> <87sft8tah0.fsf@trop.in> <87zgnfbtao.fsf@gnu.org> <87v8xzyddf.fsf@trop.in> <87v8xz54n9.fsf@gnu.org> Date: Wed, 02 Feb 2022 09:59:11 +0300 Message-ID: <87fsp1zrcw.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53466 Cc: 53466@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-02-01 10:15, Ludovic Court=C3=A8s wrote: > Hi Andrew, > > We=E2=80=99re 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 skribis: > > [...] > >>> Yes, that=E2=80=99s the usual tradeoff. The choice made so far in Guix= has been >>> to choose clarity over faithfulness to upstream=E2=80=99s 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=E2=80=99t have to be a single answer. For Redshift a= nd its > handful of options, I see little incentive to go look at =E2=80=98man red= shift=E2=80=99; > it doesn=E2=80=99t 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=E2=80=99m aware of Clojure specs, but I don=E2=80=99t find it convincin= g 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=E2=80=99s not something we usually do for sy= stem >>> services. >> >> Imagine terminal or almost any other user space program > > I=E2=80=99m not imagining: we=E2=80=99re discussing a very concrete servi= ce here. :-) > > For Redshift, I don=E2=80=99t see the point of making the config available > globally. For system services, there=E2=80=99s only a handful of excepti= on (PAM > and OpenSSH come to mind, but see /etc). > > Again, there doesn=E2=80=99t have to be a single answer. I suspect many > services won=E2=80=99t need to make their config available under ~/.confi= g, but > if some do, so be it. I=E2=80=99d say that the default should be to not = make > config available unless that=E2=80=99s 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=E2=80=99m 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 =E2=80=98redshift=E2=80=99 to the user pr= ofile would be > to allow =E2=80=98man redshift=E2=80=99. > > I don=E2=80=99t view it as super useful in this case, and would instead l= ean on > the side of not =E2=80=9Cpolluting=E2=80=9D the user=E2=80=99s profile, b= ut I can very well > imagine that in other cases we=E2=80=99d prefer to extend the user=E2=80= =99s profile. > >>> I understand your concerns, but I think they=E2=80=99re beyond the scop= e of this >>> review. I also think that there=E2=80=99s ample experience with system= services >>> showing that writing =E2=80=9Cnice=E2=80=9D configuration bindings actu= ally 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=E2=80=99s more complex than this. = :-) Also, maybe my non-guile experience doesn't apply here. > > As it turns out, I find Guix=E2=80=99s configuration records rather nice = to > use=E2=80=94much nicer than, for example, Gnus=E2=80=99 loose configurati= on trees. Unfortunately, I'm not familiar with Gnus internals and can't say if it's related, similar or not. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmH6K78PHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wi8cP/jUbawgZB2j7UUyN3b7GedLqCEQyPKqJBwwY OlwCIT+t8BADpMWvbHeXdZze69N8Dq0LZSBYzO4SkX615Y+m7h5P4Y+fN9gCip7W QYcXuupMAwwiS+H36r10AQrhdLaWpkP81JGmhrOJ3NfdYbOu6nmuLu+UyK1+8FUy hvBG/Q568heBcA6y8QgMtr052EJpu1IlBZ5kYxI7EKZjoA3LN8FINKkijH1GZNw3 1Zxp6c1OLAGAQJ0eV9jrjHKKDpiSvcGozaKaU6xtLdfdvkhfhTS5KBac+Rc5N20Y siXWeHCzz5XqVRi7VMNM9FEQl8BE0UdDgpOGVmS4JHb3HOM87MfVZWZc+EalVWVF biM8bQlXxH31EascJwJcrdJ8N6QBP4L3VK//XMi+7Qj7mNmoSqvE1dEuGMiGuR9l ViW+uuY6BKRJF2LEj69VOEwnIkkNKO+s9kkOMQiOAbsi46meCzAo5V22KMbvmgS7 oWB+drg/UIb2zyDsW8O+AQnlcnhwfEx/FUfz6f6J9lV43fsHdQXWr4uBu4dO/2dy 9MnYFzXVxP4/ckx1keCPj1kfA2SKctNIw3NSxGNKJP62TtfwO04dK3tJPbMhgyBA 9uvUttazmY3ABs/XekjuPYSEA7Oo9Dgt512xA2ARQRYPo/Iel/VGZjgbEnAtiUwU IjPGFgjA =A+fP -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 02 02:48:29 2022 Received: (at 53466) by debbugs.gnu.org; 2 Feb 2022 07:48:29 +0000 Received: from localhost ([127.0.0.1]:51317 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFANQ-0001lV-WE for submit@debbugs.gnu.org; Wed, 02 Feb 2022 02:48:29 -0500 Received: from mail-lf1-f53.google.com ([209.85.167.53]:40941) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFANO-0001lC-OW for 53466@debbugs.gnu.org; Wed, 02 Feb 2022 02:48:27 -0500 Received: by mail-lf1-f53.google.com with SMTP id a28so38834076lfl.7 for <53466@debbugs.gnu.org>; Tue, 01 Feb 2022 23:48:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=7KhBGqZ7y8/pgwmjVcu+rxamHWcZU65SrcJtr7wz9kM=; b=FP8B5GN2D3l8rZBJWsApBSj3OqiDllchEh0AYyLeArgDPI1pGP1L02EXRqPOLatKZs xHb51MvOFpkdja8Bg/ZLRr2Nh6boWTc4xm8jh/RSpEd4gYIVcgPrUrdFzRtQXsKq6vtN n03pZljUywzrgjgQPknYU4WVnN/pFhjbs54OLT+O2jnQkeCvP1/VZlyHr3XIFHkRZiZU P41cM0c9XtF3NpYEa847Z0KapMsr33VudOrYLrehFnwF5axCooXL04BAMD57ztMC+BD8 7u0ejzOqro8hidxr8yPQGYu31EUtk11kqkHEzCKSqhHU9DJqyMT0RKD8yxV8N3KFmAuS yL+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=7KhBGqZ7y8/pgwmjVcu+rxamHWcZU65SrcJtr7wz9kM=; b=q7f8HQ4oL57epuCatVCRQzGIe5OVJtPvwzHMKwEhAtA8z00lqwMtz1kdQWQtRamNee wgjOvB79W7sj8mCnlehWcXENWX2tJr426pY1wS0ElA7En389VmP36iXuaN/G7fiIPR4q n7hp2pFBOdMVZT3nSJ1WWQ67ygw1HyVa9QE2lzWXjf3jlne/ZFNgoc1pSF/sAvGS8HEH /wIFoqcbKLG5EJvW+8OWJPVgWtWKm0hoG5BkT3bfUadVqnDLUl2OqgBjN7EYJQ06o75a XKr+zWbVuqPfzjZhsCVsw+jtcxdg+NJgtsTBq8j7BBOOsu4zjTVeAsKn8QtKfOrPU/G7 6P6w== X-Gm-Message-State: AOAM532jaV4VWgbAFP2FiGbquN0geggfIDG2HK7dB8C/iHrSWHeP5r+D tJovm937jX6hxHW55PuxfJn07g== X-Google-Smtp-Source: ABdhPJzU/uXcbS7pQDAFncPpjXHXMlL/h+/nPf779Tjrdk4U7G6qQbbHLFQrBrqY2uCVAeTz+T/pkw== X-Received: by 2002:a05:6512:e90:: with SMTP id bi16mr22564392lfb.21.1643788100366; Tue, 01 Feb 2022 23:48:20 -0800 (PST) Received: from localhost (109-252-135-33.dynamic.spd-mgts.ru. [109.252.135.33]) by smtp.gmail.com with ESMTPSA id f7sm2396592lfs.183.2022.02.01.23.48.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 23:48:19 -0800 (PST) From: Andrew Tropin To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#53466] [PATCH v2] home: Add redshift service. In-Reply-To: <87leyv6kp1.fsf@gnu.org> References: <87sft8tah0.fsf@trop.in> <20220130151139.3857-1-ludo@gnu.org> <87r18nybq5.fsf@trop.in> <87leyv6kp1.fsf@gnu.org> Date: Wed, 02 Feb 2022 10:48:16 +0300 Message-ID: <87bkzpzp33.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53466 Cc: 53466@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-02-01 09:43, Ludovic Court=C3=A8s wrote: > Hi, > > Andrew Tropin skribis: > >> On 2022-01-30 16:11, Ludovic Court=C3=A8s wrote: >> >>> * gnu/home/services/desktop.scm: New file. >>> * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. >>> * doc/guix.texi (Desktop Home Services): New node. > > [...] > >> Probably, I already mentioned, but combining renamed option names from >> the configuration record and option names in the escape hatch is >> inconsistent, confusing and error-prone. > > I think I replied already. > >> It's very unclear where this extra-content goes and user can't know it >> until he check out the implementation or build the config (currently >> it's also almost impossible to find it on file system after build). > > (He or she.) I documented it in a way that I thought was clear: > > @item @code{extra-content} (default: @code{""}) (type: raw-configuratio= n-string) > Extra content appended as-is to the Redshift configuration file. [=E2= =80=A6] > > Notice =E2=80=9Cappended=E2=80=9D. How would you phrase it? (: >> Using such type of escape hatch is no joy at all. > > Escape hatches are meant to be used as a last resort; they=E2=80=99re a h= ack. > Normally, people would have everything they need with the provided > bindings. So yes, using them is no fun, but that=E2=80=99s not a surpris= e IMO. > >> Seems this one is missplaced and should be go before [manual] section, >> otherwise it won't be possible to set values of redshift section. And >> doing so will lead to very ugly: >> >> (extra-content "\ >> dawn-time=3D5:30 >> dusk-time=3D18:30 >> [geoclue2] >> some-other-option=3Dvalue >> # Do I know that I'm in the middle of config file?") >> >> It will be especially ugly or even erroneous, when the target config has >> a format, which uses identation. >> >> I didn't try it for redshift, but in many ini parser it's forbidden to >> repeat sections with the same name. > > Ah, bummer. > > Another way to see it is that I should augment the bindings, maybe > that=E2=80=99s what you=E2=80=99re getting at? :-) Sorry, not sure if I can translate your question correctly, so I won't try to answer it, but will rephrase my statement to crarify what I mean: The current implementation of escape hatch doesn't work (I can't set missing options in redshift section, because extra-content added after manual section begins, and I'm not sure if redshift's ini parser allows to define a section with the same name a few times, Git for example allows to do so, but it's more an exception). There are a few ways to fix = it: 1. Move manual section on top of redshift section, so the extra-content will be added just after redshift section 2. Move extra-content before manual section to accoplish the same. 3. Use file escape hatch (as it done in some system services), which will invalidate all the options set before and just place the content of file field as a value of configuration. 4. Provide the bindings for other options (probably what you were asking). > > I can do that. > >>> + #$(home-redshift-configuration-extra-content config))) >> >> A little offtopic: >> >> I know a number of system services, where the extra-content goes in >> unexpected locations and overall behavior of escape hatch is unexpected >> and incosistent with other escape hatches. Some of the services has a >> number of escape hatches in almost every nested record with different >> names and behaviors. >> >> I'm relatively fresh Guix user and this part really confused me at first >> even having experience with NixOS module system before and it's very >> likely that many people just don't report it, because it really hard to >> get the roots of it. > > How does NixOS handle escape hatches today? Back when I was using it is > that it wasn=E2=80=99t any more consistent than what we have today, which= is at > least a consolation. I don't remember, how it's done for nixos "system modules", but in home-manager it's relatively consistent, in most cases it just a nested maps (attrsets, a little more high-level analogue of alists): https://rycee.gitlab.io/home-manager/options.html#opt-programs.git.extraCon= fig https://rycee.gitlab.io/home-manager/options.html#opt-accounts.email.accoun= ts._name_.msmtp.extraConfig https://rycee.gitlab.io/home-manager/options.html#opt-gtk.gtk3.extraConfig Sometimes, it allows to add a multi-line string to the end of the file: https://rycee.gitlab.io/home-manager/options.html#opt-programs.abook.extraC= onfig but it's getting deprecated, when proper serializer for target config format is implemented: https://github.com/nix-community/home-manager/blob/master/modules/programs/= git.nix#L342 As you can see, they provide a list of frequently used options as top-level "fields", but all of them, including extraConfig just extends (get merged) to primary "config" (iniContent for git for example) and after that, this primary "config" attributeset get serialized to the target config file. While they have this "escape hatch", it works the same way as all other fields with the only difference: it doesn't have schema (just untyped attributeset). This is quite close to what we do in rde. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmH6N0APHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wdvAP+QEfw3138OtNcg+ZeX3T/Chd/+AlCk78mO60 WpFkTXrL3f3krJpd8+ArIZV0mMuVVzQ5H6tNOfEfeIkySKsxLUtHBK5aUn3vOQGA /BqXdfUOnm9PwSxrraYQhm7J/B0KcyYs049V9JZXcNMQv8HIjgQr3+g/6DT9L4CG C0w3Q7kadbM5MMkH4hLBJ/Fi/SqxZXgPfYsVvXBAq4pfy7pzl9vAz8f95yp3M55A 6N6F+zhRbql0KHsAMdYSym2qki5dEU9lTis++gY9zDmXlIbZY+XCMrYWKLicVB0r 6ZEQUjHicoaZN92zrhNRhASuiTLid6GvFQfRLop3LLR6ZjVip96VcHzj71NENXMO GTJYM39pdJwj0z62bFaxFUIRpCgWaK8QLUtyhcAAOgOQ+RtgREyHYixaStcdWx+V iUhXcuPGG2pR6Qf6VLWdr9vu5IZeVWetUMueZ9mH9sJ2geCSeRk1xl2ktu+dgUxm ZSlGvdNtgqcQGAWmi5CVyHXUVckIlzqatgQl/6F9ZuIDwAJTrVGMv+59v47IrpVF Rw1RyCe6B7hecC5o/vS+ptvF4D8h8Ai6JWSDcP0zF0L12aJ2lvH32gEbJxTW1AXu Zdta3SmD8/GsVUg7bhF7DfY0Rrzn0tLfYHRB5Rafk7rwjCgWtqHhmWaQj9ocxctS XBLzWn2y =cPfd -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Feb 02 03:57:45 2022 Received: (at 53466) by debbugs.gnu.org; 2 Feb 2022 08:57:45 +0000 Received: from localhost ([127.0.0.1]:51401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFBST-000448-8f for submit@debbugs.gnu.org; Wed, 02 Feb 2022 03:57:45 -0500 Received: from mail-lj1-f181.google.com ([209.85.208.181]:35718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nFBSP-00043l-Ad for 53466@debbugs.gnu.org; Wed, 02 Feb 2022 03:57:44 -0500 Received: by mail-lj1-f181.google.com with SMTP id q127so27894901ljq.2 for <53466@debbugs.gnu.org>; Wed, 02 Feb 2022 00:57:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=kDJuIRoEliTkem242lbFOCFUaGGyzZ8pqzwcEEJtBLU=; b=GMvsVmPYYojdsrFx5TiQvXeScyZYfhBzolIy3mqp6WixM6OF5csfKUTGfNgGtBgH08 FZyPsBPNoxLCCBDQQ/yQ6ezYuTKY6nDzLRpy2V5+9h+EmBCTo7zaUFGRiCc9b4Yf0i5v S+J5jDyJ2O29y/Dg8bc4mKPUP7QrJGT3XPkRbEzcYn8QshbPBvkRa/Wkr5AknslMpAum vF+v6DK+QmG6Oy1IKKulx+MnhqOHM9pImPZXCv0jTJ65EmuA/UgaOtpzwnvrGqpljBCC JsgIkahMANAlTTXCXZLEpjcWYxnPmx2UI+3YPTjU072Drj2Jq79D428bipudCr5BtdTl PoUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=kDJuIRoEliTkem242lbFOCFUaGGyzZ8pqzwcEEJtBLU=; b=35QEiHdzr1U51kUkc4BXJ/knUby6a/A71XA1koOUeprzGLN/YXiYX/0by4AuLU2zNn 6e/BXVBoYHT10GLzZvSmlRz7LKjLZQu2RaIQU/OfhmNtqZL715pRfXWWWA3ragLth4IR XCpK5KcgZvbvczqkHJCldea72Xc2xZqaZxFPzuVEmeiXQeLa+UHfFJyRi5O++T/fXRTT cyXmfWA65YN6kMBPGMePCDHJ6Z9trqm94sUBlZ5fK4NMNll+y9i2hOQ0tD0DlZdzWMIf quEiDvluhWDbrw1NZTLWJDd+uR8QhK/lVWv9a7h3Xi5+q5ZGL08fxOwTHJBW7xMSvA0X GAKw== X-Gm-Message-State: AOAM533Wos6OPKbeVy6Fj5mQj8P9kgd+NPEiEiyZb3Nc7tmoyq/L2Vvj DYKwp7oF4y2TyML3DpAWCg593DmVb2q83g== X-Google-Smtp-Source: ABdhPJxFBfxebKC9KF/YTHYW0LPt9oJMZzNU41cPPXe+T9RgQbU8t0OqmaI6xHR9+PjuZDpprzgIOA== X-Received: by 2002:a2e:5857:: with SMTP id x23mr18746314ljd.529.1643792255093; Wed, 02 Feb 2022 00:57:35 -0800 (PST) Received: from localhost (109-252-135-33.dynamic.spd-mgts.ru. [109.252.135.33]) by smtp.gmail.com with ESMTPSA id x12sm3362716lfr.23.2022.02.02.00.57.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Feb 2022 00:57:34 -0800 (PST) From: Andrew Tropin To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#53466] [PATCH] home: Add redshift service. In-Reply-To: <87v8xz54n9.fsf@gnu.org> References: <20220123111159.27020-1-ludo@gnu.org> <87sft8tah0.fsf@trop.in> <87zgnfbtao.fsf@gnu.org> <87v8xzyddf.fsf@trop.in> <87v8xz54n9.fsf@gnu.org> Date: Wed, 02 Feb 2022 11:57:31 +0300 Message-ID: <874k5hzlvo.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53466 Cc: 53466@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-02-01 10:15, Ludovic Court=C3=A8s wrote: > Hi Andrew, > > We=E2=80=99re drifting away from the practical issue of adding a Redshift > service, but you raise interesting issues. I have a few more to raise, but they are unrelated to redshift and even weakly related to configuration styles :) Overall, I'm ok with this redshift service and if you are sure that tradeoffs accepted by guix system services are correct even in the light of issues I mentioned and we don't need to try a slightly different and more data-structure oriented way, I think we can proceed with this service. Just give it one more week, after a next revision of the patch with fixed escape hatch is published, just in case someone else has good arguments, but didn't speak yet. I think I'll move (gnu home-services ...) I personally use and incompatible with system services approach to (rde home services) not to confuse people and will maintain them myself. But I'm ok if someone would like to rewrite to the usual style and upstream them, I will help with the review. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmH6R3sPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wLNAP/3ts5MC9M+KRCkiDoVW9WMXN/H8XdVO5GjeD XAwrjbW+fF1iwMkoExy6hIPTmsOAOB+XaX9AGH2cMKUPjRd8p2O+i9vYIqrnwZ5s n+C1b9MsuPQASKr1DWxioP5a1slwmySJtfW80d+WWH3u42aK400gL1Vw38LDHIt2 Cx7YIV1H7mX7GnF2Ad0ONkYYq7k0VvvvCKTIvoIfEKQluQX6hp8Wf6C9VEzSph+2 w1YgH2QxYPn7+ffHGRgPBHHkfQyk7v+vpB4WOelp0T6ftibvM7fitpg0h/Vcd/uk 2MQg5l9yeEH9XxDaqlnoZt6y0b0ZcK+YmZdRUos0DnL40yE8CdNlU1r1hgUVct04 1SpDP21BHsbCAo8EXhjRpdE8u4QP5qTXkVF09OXKPwPuCtQot1hS18f5vGEfwNcH muhDNwLKwEK4x2myTTiq6wlreYAfuEWvGqIVG5F+9749QQUy6haYdoIjTw/Hm1fY qqLWs+YbCGQsc/HcQTvSxAOX3fs+KXN4bQxJCI+bFNBbdcoDiawPThvPJYHC8sUQ 68+ulLY4X4pgXfrLKW5O/9bdo4es/zg30w6nnVWNzabMgYL/yvPitoIsVqoAMalz /pbByauld1TT4G5R/prZcJ9BhLJPw4GCDoo0TjEYjbh57RIU+RIk8z1hqygwj68Z YB+J8Qw0 =Wa8S -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 06 18:13:27 2022 Received: (at 53466-done) by debbugs.gnu.org; 6 Feb 2022 23:13:27 +0000 Received: from localhost ([127.0.0.1]:40207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGqik-0002bk-ON for submit@debbugs.gnu.org; Sun, 06 Feb 2022 18:13:27 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:44770) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nGqij-0002bW-To for 53466-done@debbugs.gnu.org; Sun, 06 Feb 2022 18:13:26 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 1BED479; Mon, 7 Feb 2022 00:13:19 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KqigZdBEWmp5; Mon, 7 Feb 2022 00:13:18 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id A895F74; Mon, 7 Feb 2022 00:13:17 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Andrew Tropin Subject: Re: bug#53466: [PATCH] home: Add redshift service. References: <87sft8tah0.fsf@trop.in> <20220130151139.3857-1-ludo@gnu.org> <87r18nybq5.fsf@trop.in> <87leyv6kp1.fsf@gnu.org> <87bkzpzp33.fsf@trop.in> Date: Mon, 07 Feb 2022 00:13:17 +0100 In-Reply-To: <87bkzpzp33.fsf@trop.in> (Andrew Tropin's message of "Wed, 02 Feb 2022 10:48:16 +0300") Message-ID: <87bkzjfv1u.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: 1BED479 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 53466-done Cc: 53466-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi Andrew, Andrew Tropin skribis: > The current implementation of escape hatch doesn't work (I can't set > missing options in redshift section, because extra-content added after > manual section begins, and I'm not sure if redshift's ini parser allows > to define a section with the same name a few times, Git for example > allows to do so, but it's more an exception). There are a few ways to fi= x it: > > 1. Move manual section on top of redshift section, so the extra-content > will be added just after redshift section > 2. Move extra-content before manual section to accoplish the same. > 3. Use file escape hatch (as it done in some system services), which > will invalidate all the options set before and just place the content of > file field as a value of configuration. > 4. Provide the bindings for other options (probably what you were asking). Ah got it. I went for #2 and #4 (there are still missing options, but we can add them when people actually need them.) Pushed as 39e8025d3b40a0079f75e0ce9a91b6dad6766773. >> How does NixOS handle escape hatches today? Back when I was using it is >> that it wasn=E2=80=99t any more consistent than what we have today, whic= h is at >> least a consolation. > > I don't remember, how it's done for nixos "system modules", but in > home-manager it's relatively consistent, in most cases it just a nested > maps (attrsets, a little more high-level analogue of alists): > https://rycee.gitlab.io/home-manager/options.html#opt-programs.git.extraC= onfig > https://rycee.gitlab.io/home-manager/options.html#opt-accounts.email.acco= unts._name_.msmtp.extraConfig > https://rycee.gitlab.io/home-manager/options.html#opt-gtk.gtk3.extraConfig > > Sometimes, it allows to add a multi-line string to the end of the file: > https://rycee.gitlab.io/home-manager/options.html#opt-programs.abook.extr= aConfig > > but it's getting deprecated, when proper serializer for target config > format is implemented: > https://github.com/nix-community/home-manager/blob/master/modules/program= s/git.nix#L342 > > As you can see, they provide a list of frequently used options as > top-level "fields", but all of them, including extraConfig just extends > (get merged) to primary "config" (iniContent for git for example) and > after that, this primary "config" attributeset get serialized to the > target config file. While they have this "escape hatch", it works the > same way as all other fields with the only difference: it doesn't have > schema (just untyped attributeset). This is quite close to what we do > in rde. OK, I see. Nix is all about attribute sets, which are dictionaries, like alists, and just as sloppy: you can add attributes but they may or may not be ignored, you never know. Here they =E2=80=9Ctake advantage=E2= =80=9D of that, IIUC, by serializing attributes that happen to be here. Nix (the language) doesn=E2=80=99t have the ability to define disjoint types like what we=E2=80=99re doing with configuration record types, and to me th= at=E2=80=99s a weakness that directly affects usability. Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 07 10:16:31 2022 Received: (at 53466-done) by debbugs.gnu.org; 7 Feb 2022 15:16:31 +0000 Received: from localhost ([127.0.0.1]:43236 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nH5kl-0000fv-1y for submit@debbugs.gnu.org; Mon, 07 Feb 2022 10:16:31 -0500 Received: from mail-lf1-f44.google.com ([209.85.167.44]:38854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nH5kf-0000fe-H9 for 53466-done@debbugs.gnu.org; Mon, 07 Feb 2022 10:16:29 -0500 Received: by mail-lf1-f44.google.com with SMTP id z4so12700515lfg.5 for <53466-done@debbugs.gnu.org>; Mon, 07 Feb 2022 07:16:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=guSz5YOb0zWOny81p5CngaRsHeaUDUddBX6k1P+V+TA=; b=FkuwETecQMg9AjGqbMNVgdXUMj4lqeRV1AW01kuS8iXrLBQR2o5Fk8MWqbYfcXK/xl HPX6GwC53s/tIu+Mcg6GrEZvdzQ2PQrId37D9GVutAf8T1bVGR9YzZscWGUTRCTbjq0y JiW/6mwAILU/mrWtIM1wJFyA5SRcSSkLyU5ukoWlhRu7zJjADgyN2oERj/E9kHZJDO9v ty74/a6kAGdddQcsbr8pLaMofkf3FyB7xL94HJf5i0c7avPyXiw/2+65eZDpJdJtr0XZ U6FmumK/WqpcdNPWdZE4mmRAVY8HJk+ksv4Fc5GZrOWR5Af8h9y8c+dM8CI7ce0Gcxsb kt0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=guSz5YOb0zWOny81p5CngaRsHeaUDUddBX6k1P+V+TA=; b=I19DiF3qB4cGCsqbiU3JEUevzH2fAn4MpPfgApll/IUKb+amrjjk7pTHBJETNSObDn LJVr56JlwTG0n1ksoUjLc/WKJ0cw71aWIvZMU4EiTT1ZNocUJ9M90upPZHjIix+HCivZ ryBR9xCCsSNmnc7Ewzfgcbf8ZVgxhbFdq3+hSkXNwYu6P/kmblE2/pIY+56aacb6SXCw z2mEenGnM0LNeCUqIlTRTqjOtubg0vkz51zfpS/i1cj6ygfdlu8X9dg6M7K+lhozYI/4 Ref1OrnHMY2nQZHvphloxn4OK7OgfGXDGix89YgNXycUJBOUCGdkiJo+ihf0SmQVjTtQ FRHA== X-Gm-Message-State: AOAM530nZ9O75rhu/OE5lI/SP9SLy/WlqUVIb40EloZIhvcDw6oG1rSw oEd0a/lxROMSvi6JC1fSFqnLY+EtqIEUsg== X-Google-Smtp-Source: ABdhPJybgDt3oGR0UQGFgWQCbaBa7kad3iVeepNScKnBGf+G7vnfcFv0+IOrp7WHolw+ym4krS02fw== X-Received: by 2002:a05:6512:6c9:: with SMTP id u9mr15989lff.207.1644246979473; Mon, 07 Feb 2022 07:16:19 -0800 (PST) Received: from localhost (109-252-135-33.dynamic.spd-mgts.ru. [109.252.135.33]) by smtp.gmail.com with ESMTPSA id c20sm1528074lfb.129.2022.02.07.07.16.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 07:16:18 -0800 (PST) From: Andrew Tropin To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: bug#53466: [PATCH] home: Add redshift service. In-Reply-To: <87bkzjfv1u.fsf_-_@gnu.org> References: <87sft8tah0.fsf@trop.in> <20220130151139.3857-1-ludo@gnu.org> <87r18nybq5.fsf@trop.in> <87leyv6kp1.fsf@gnu.org> <87bkzpzp33.fsf@trop.in> <87bkzjfv1u.fsf_-_@gnu.org> Date: Mon, 07 Feb 2022 18:16:15 +0300 Message-ID: <87wni67lmo.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53466-done Cc: 53466-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-02-07 00:13, Ludovic Court=C3=A8s wrote: > Hi Andrew, > > Andrew Tropin skribis: > >> The current implementation of escape hatch doesn't work (I can't set >> missing options in redshift section, because extra-content added after >> manual section begins, and I'm not sure if redshift's ini parser allows >> to define a section with the same name a few times, Git for example >> allows to do so, but it's more an exception). There are a few ways to f= ix it: >> >> 1. Move manual section on top of redshift section, so the extra-content >> will be added just after redshift section >> 2. Move extra-content before manual section to accoplish the same. >> 3. Use file escape hatch (as it done in some system services), which >> will invalidate all the options set before and just place the content of >> file field as a value of configuration. >> 4. Provide the bindings for other options (probably what you were asking= ). > > Ah got it. I went for #2 and #4 (there are still missing options, but > we can add them when people actually need them.) > > Pushed as 39e8025d3b40a0079f75e0ce9a91b6dad6766773. > Good, thank you for working on this!) >>> How does NixOS handle escape hatches today? Back when I was using it is >>> that it wasn=E2=80=99t any more consistent than what we have today, whi= ch is at >>> least a consolation. >> >> I don't remember, how it's done for nixos "system modules", but in >> home-manager it's relatively consistent, in most cases it just a nested >> maps (attrsets, a little more high-level analogue of alists): >> https://rycee.gitlab.io/home-manager/options.html#opt-programs.git.extra= Config >> https://rycee.gitlab.io/home-manager/options.html#opt-accounts.email.acc= ounts._name_.msmtp.extraConfig >> https://rycee.gitlab.io/home-manager/options.html#opt-gtk.gtk3.extraConf= ig >> >> Sometimes, it allows to add a multi-line string to the end of the file: >> https://rycee.gitlab.io/home-manager/options.html#opt-programs.abook.ext= raConfig >> >> but it's getting deprecated, when proper serializer for target config >> format is implemented: >> https://github.com/nix-community/home-manager/blob/master/modules/progra= ms/git.nix#L342 >> >> As you can see, they provide a list of frequently used options as >> top-level "fields", but all of them, including extraConfig just extends >> (get merged) to primary "config" (iniContent for git for example) and >> after that, this primary "config" attributeset get serialized to the >> target config file. While they have this "escape hatch", it works the >> same way as all other fields with the only difference: it doesn't have >> schema (just untyped attributeset). This is quite close to what we do >> in rde. > > OK, I see. Nix is all about attribute sets, which are dictionaries, > like alists, and just as sloppy: you can add attributes but they may or > may not be ignored, you never know. Here they =E2=80=9Ctake advantage=E2= =80=9D of that, > IIUC, by serializing attributes that happen to be here. > > Nix (the language) doesn=E2=80=99t have the ability to define disjoint ty= pes > like what we=E2=80=99re doing with configuration record types, and to me = that=E2=80=99s > a weakness that directly affects usability. > > Thanks, > Ludo=E2=80=99. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmIBN78PHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6wYhMP/i9qfRRRJBRm1oPE2Lk1fBgpebmk+eYMD/pC u9Ev3ea6bwc8KMexRtTsn8UBonMFaDVnD7y7fyHFK9uzJzweHX15kiRLhiZhhEN1 6JM/VXOoBqNAV1s+uEdPtSQimfPljhz4NKgn80jDDygSj9Y1yd8oqLeQRbswcwKR a5GkRo21osfsRPkla39tt3vlY9BAkeboIZdLWbP2/T0fFzKcaXuwDEf/+41sLyGm yR+jq3ubO02O53q7rvwIx2oat8CEq8LRCvuer7Cr511N6tewZeMIosSN3NNd2n6E 8AygtbZDmdB4w6MetP06wsSKi+nJq8uZj0Dm2v6Me6MV0kXFhrgT1iBu6uJuhXDn YlE9dHVxbp2JYwOkYuxMmt3LJ27LjUc0wXqBr+U35/4mfhzoBmoQHzm2seDASrHv +q6TIqNsjJVut7yr8XxT19ROFIeI1MeWLTGh4GN6ddzj9wwM8Mxm54zFgWKnX0i6 kjuYMhqX5YXOIN0W6NkvRuhl8W8c/sD8FmjNOlxzdlwca55lix+v/FxQ347FpAhi QcQfygpva/Mug+v6aUaIHaX9LBnlXPHzxUs8YKexd3C6YH5WptYGsup/piUBo7rc 9a7LiVv5dGevd8lmGBMwKpYQK4wWGGCTlQmiryapKlmkQQRpzEp1NmGdIXQ3cA8v nQT3MCrG =ZQXd -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 08 04:22:58 2022 Received: (at 53466) by debbugs.gnu.org; 8 Feb 2022 09:22:58 +0000 Received: from localhost ([127.0.0.1]:45291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHMhv-0001zA-Gt for submit@debbugs.gnu.org; Tue, 08 Feb 2022 04:22:58 -0500 Received: from hera.aquilenet.fr ([185.233.100.1]:34910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHMhu-0001yt-1p for 53466@debbugs.gnu.org; Tue, 08 Feb 2022 04:22:42 -0500 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 77D13395; Tue, 8 Feb 2022 10:22:34 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7gJ-AQrDymxM; Tue, 8 Feb 2022 10:22:33 +0100 (CET) Received: from ribbon (unknown [193.50.110.192]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 6F334132; Tue, 8 Feb 2022 10:22:33 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Andrew Tropin Subject: Re: [bug#53466] [PATCH] home: Add redshift service. References: <20220123111159.27020-1-ludo@gnu.org> <87sft8tah0.fsf@trop.in> <87zgnfbtao.fsf@gnu.org> <87v8xzyddf.fsf@trop.in> <87v8xz54n9.fsf@gnu.org> <874k5hzlvo.fsf@trop.in> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 =?utf-8?Q?Pluvi=C3=B4se?= an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 08 Feb 2022 10:22:32 +0100 In-Reply-To: <874k5hzlvo.fsf@trop.in> (Andrew Tropin's message of "Wed, 02 Feb 2022 11:57:31 +0300") Message-ID: <878ruld86f.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: / Authentication-Results: hera.aquilenet.fr; none X-Rspamd-Server: hera X-Rspamd-Queue-Id: 77D13395 X-Spamd-Result: default: False [-0.10 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 53466 Cc: 53466@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Hi Andrew, I hadn=E2=80=99t noticed this message of yours earlier=E2=80=A6 Andrew Tropin skribis: > I think I'll move (gnu home-services ...) I personally use and > incompatible with system services approach to (rde home services) not to > confuse people and will maintain them myself. But I'm ok if someone > would like to rewrite to the usual style and upstream them, I will help > with the review. Alright noted. I would obviously prefer if you would instead contribute those services to Guix Home proper=E2=80=94that was the whole point of gett= ing it merge in Guix in the first place, right? I feel that perhaps, contrary to what I thought, we hadn=E2=80=99t reached a shared understanding of what it means to maintain things collectively withing Guix. It=E2=80=99s a bit of a sad situation, but I=E2=80=99m sure = there=E2=80=99ll still be good things happening in Guix Home, and in rde. Thanks, Ludo=E2=80=99. From unknown Wed Jun 18 23:18:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 08 Mar 2022 12:24:13 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 13 05:41:50 2022 Received: (at control) by debbugs.gnu.org; 13 Mar 2022 09:41:50 +0000 Received: from localhost ([127.0.0.1]:41655 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTKjV-0005uo-Vz for submit@debbugs.gnu.org; Sun, 13 Mar 2022 05:41:50 -0400 Received: from mail-lf1-f52.google.com ([209.85.167.52]:34641) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTKjT-0005uY-Pa for control@debbugs.gnu.org; Sun, 13 Mar 2022 05:41:49 -0400 Received: by mail-lf1-f52.google.com with SMTP id e6so15618988lfc.1 for ; Sun, 13 Mar 2022 01:41:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:subject:date:message-id:mime-version; bh=ckHH50rxj5YLe/SV0Wxi6xumG9Sz5I90MdaHx5T+pI8=; b=MvrUlfwB88dIHMTCCdI7mpytb7aIKAKAymVtUX7o8l0hab/U0GDFlUtvhNOwa8Gcty hY8uf6EW56dMJqOV6OnIEKruyWEVKMsuVTnzmt/pwZjLYjwbirbcHo4GhEzLOyWqn0H9 9KZX0Ii3wJNCU0nZcFF2vHn/+6ir3SIobZ1C37EpOfmqbO1XHOlnjlfrfyl/sD97rjrR gfSFAULRtRfzpYR2sL+a0+ubcG0alSUzbGZ4HTc+i0boPW4tDhXlGirSGn+ZDlBXda2z 5jqARKpUQTM0ekCQ2R3DCxgkSRoL6cRxJ98s3VxrgeAMWXQowJdYbkZmrUMUR4S+KaXe nZdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=ckHH50rxj5YLe/SV0Wxi6xumG9Sz5I90MdaHx5T+pI8=; b=bm9YM4ZDoYb0ZUd8/N6nMMGcDx1aPNluj298feZ/VBvDRcEke7X5nYW+FhRmx9lAoc 82tPO6PNSdVOfzOepW79t2i7EeQFglL7lts4xOt03p7sGi0gASxhwS5qvGAq4LV1Phi/ JV8kpngahd8rUk+nv/da3nU8XdhLwoY+Uv2YhunPQshzwjsyF5Q95jl9CT+RTvvtThHi WVCk50eXuGB79u9q+7711h3vh/GernE2RyzSrLX2rbnB++WL2vqb3sJeIGelTqp20vBf +6IE3w9psgWlU+UUo0HFc15CnhH+cC94WDN6JZ7U5adSmFJlRhV3gCswphOsMyW8H3En sttA== X-Gm-Message-State: AOAM533Uid+LtHs4nH8tfTpRv18o2T/P6uY/9TqTrDX1NANK1KMD5Q5q 9qUMOdZFt4+lhZZuQdi3lPR+C6/SrXwhiA== X-Google-Smtp-Source: ABdhPJweVVUng6nlRcH/CulgkvrpFic06znW7+iRwuX58JE+ryNQP4zNuAis/arKd3BCzlow9hjvCA== X-Received: by 2002:a05:6512:3d23:b0:448:36d8:2d1a with SMTP id d35-20020a0565123d2300b0044836d82d1amr11100028lfv.368.1647164501264; Sun, 13 Mar 2022 01:41:41 -0800 (PST) Received: from localhost (109-252-135-33.dynamic.spd-mgts.ru. [109.252.135.33]) by smtp.gmail.com with ESMTPSA id 10-20020a2e080a000000b00247f82bbc6fsm3076029lji.54.2022.03.13.01.41.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Mar 2022 01:41:40 -0800 (PST) From: Andrew Tropin To: control@debbugs.gnu.org Subject: Date: Sun, 13 Mar 2022 12:41:37 +0300 Message-ID: <878rte6vfy.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: unarchive 53466 Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.167.52 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.167.52 listed in wl.mailspike.net] 0.0 TVD_SPACE_RATIO No description available. 2.0 BLANK_SUBJECT Subject is present but empty -0.0 T_SCC_BODY_TEXT_LINE No description available. X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) --=-=-= Content-Type: text/plain unarchive 53466 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmItvFEPHGFuZHJld0B0 cm9wLmluAAoJECII0glYwd6w1X0P+waUKXUel5yuRklrQBrqvdVwfome5zyIxwxN QgYDZPBtzSezDxQ1dMZLCkB1UCWzYRAeWyF21L5c7J8WhPiZO7cTwfkbkoDYXTEv 3i7drWsUNoSOl8jPk9yl3i4cURWdy9QMOfeCS6kPvmoZzxE6edDByecsH1zAlPEV g74dqmZhvkU/MJvYdNBnYAsyX1st1L591cBmtzAaLFk50m9mEM6hOL3BL1oiaklH OPOnYJovcF2yMCKLmOQgF+S55aH+mOituVScx2aqj2fu/59mBi3YM+XAe3yZP3UH yRU7CPO2nSej6QGWh+58P65+tLHgRvHgYWTXL5lBWcoF0g4uQUYwxGRjqLU2m2LM 9j/stZInY+GlzunK/m/5iPHrEnBYvSyr/vtuIKps8sePX7c0i85+MQL4F//GcKD+ 0OjgpMsoQ36WxTl0TssV/XEKcwuqhHYfXNbioeNsRPL5IBuv/giYeJ9zJmRP90kt +PkaIyJBDPSuggr3Jiz4p3LBztfPROkSpn+boPnwrOaLudd6qM6dkeMK8z8X3n5C aKzHqe7Lr4kaaWn0lmfhwn6b/PDqpO3In9zz9iUBBW0dcm6yps/wjq4/ZmNHTBjo yHuvDg9e5tO6kHNQYAIkbmeGoH1Trf8n7IAW9Jeh0c/4eHZBv2si1JI/rx6O1+P+ YdFybKVc =rVx5 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 13 05:52:16 2022 Received: (at 53466) by debbugs.gnu.org; 13 Mar 2022 09:52:16 +0000 Received: from localhost ([127.0.0.1]:41665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTKtc-0008OW-Bh for submit@debbugs.gnu.org; Sun, 13 Mar 2022 05:52:16 -0400 Received: from mail-lj1-f173.google.com ([209.85.208.173]:43777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nTKta-0008OH-F5 for 53466@debbugs.gnu.org; Sun, 13 Mar 2022 05:52:14 -0400 Received: by mail-lj1-f173.google.com with SMTP id 25so17865153ljv.10 for <53466@debbugs.gnu.org>; Sun, 13 Mar 2022 01:52:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=5SIBwQWYxEDUFb7nNPIgIj/eIQ8TxNrgP5FWCO82rWE=; b=zq+eaySppEg865BQVmgJR4OJp5sQth8HfUFd94LOaPqkMgR+356VFCuqasTLHf80XV a3XH7Rz9TQPKykXPNdp574gpOHSgZ0Ca1A3QDPaklju7Jt2ykoTE4GamIyhhM40CNPFj QIHju2BBSeNKBaCN+OKIrMUkH2sHce3u4T2xntyUXJM/z4SmDC7ph2v8RQKu9QnG0S5O BNHRjE8k61uygOjNr4eItWa6BIgbodvsdaNZ6HENLY88rWbvcAl89TV3WNyFh5AQBpDs NJkpV7+ULi6IXBP8ytxKucb/hkg+Pk8peGeoyL9ZjJekgiUWIpkK4nkNUeqwWzaianCh eUbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=5SIBwQWYxEDUFb7nNPIgIj/eIQ8TxNrgP5FWCO82rWE=; b=EQ4XcjkQ03BQMfbr2E/+XMSTOCRQliP9g1BDlvgyvt6bal524GiLSyihlXSi2HuChK ru/Y5zgRNC6ZlTmhR6I1LqhMl8n0YP03hPFijp8/YX2i7oDxcvjZ7lrnXMUL8z9lp+u+ egUntjY1v5oBYS2OtaR79doafFP0PznTq4v9UfJaQ0vgacpwJY13km73IRiTLelHDnro 7V5kq7bUBevcZfG3JXg9AyRuPncNt+BymQbeDS5TqUQSRx8WHw8lJwHKt+TaAAbmLWFS iixV2hSNEZY4bZiawIc5C9XdEjcyWYYILto+KJjlpqqnHa4a+1s+RgZmm6LLWm9l0E8F irkg== X-Gm-Message-State: AOAM530mWCprazeE90ke57B2GPLfR0Jjeqe3NS67V1amGoWEx/qNGsvK ViokldMyizVWj4Pu9dR4n2K0ji2Q9bXI2Q== X-Google-Smtp-Source: ABdhPJwhE4z52/yR6Pdfu13G4AWIBlkGrRdArIVrcIwH6Usgu9flpGVD1EtMGbW5FB1Qo7jscIwBEg== X-Received: by 2002:a2e:5009:0:b0:247:d738:3e90 with SMTP id e9-20020a2e5009000000b00247d7383e90mr11253610ljb.229.1647165128247; Sun, 13 Mar 2022 01:52:08 -0800 (PST) Received: from localhost (109-252-135-33.dynamic.spd-mgts.ru. [109.252.135.33]) by smtp.gmail.com with ESMTPSA id r1-20020a2e8e21000000b002462940ead1sm3096470ljk.42.2022.03.13.01.52.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Mar 2022 01:52:07 -0800 (PST) From: Andrew Tropin To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [bug#53466] [PATCH] home: Add redshift service. In-Reply-To: <878ruld86f.fsf@gnu.org> References: <20220123111159.27020-1-ludo@gnu.org> <87sft8tah0.fsf@trop.in> <87zgnfbtao.fsf@gnu.org> <87v8xzyddf.fsf@trop.in> <87v8xz54n9.fsf@gnu.org> <874k5hzlvo.fsf@trop.in> <878ruld86f.fsf@gnu.org> Date: Sun, 13 Mar 2022 12:52:06 +0300 Message-ID: <877d8y6uyh.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 53466 Cc: 53466@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2022-02-08 10:22, Ludovic Court=C3=A8s wrote: > Hi Andrew, > > I hadn=E2=80=99t noticed this message of yours earlier=E2=80=A6 > > Andrew Tropin skribis: > >> I think I'll move (gnu home-services ...) I personally use and >> incompatible with system services approach to (rde home services) not to >> confuse people and will maintain them myself. But I'm ok if someone >> would like to rewrite to the usual style and upstream them, I will help >> with the review. > > Alright noted. I would obviously prefer if you would instead contribute > those services to Guix Home proper=E2=80=94that was the whole point of ge= tting > it merge in Guix in the first place, right? Originally, I planned to upstream them, but the implementation of rde home services is quite different from guix system services, that means it would be necessary to almost completely rewrite them to match the style of system services and move them to Guix proper. In addition to updating rde parts depending on those services it's a humongous amount of work. I can't do it right now for various reasons, so I will just move them from (gnu home-services) to prevent future compatibilty problems and the overall amount the usage by people who are looking for guix home services. In the meantime people looking for some missing home services can take an inspiration from rde home service and send patches to guix-patches with proper implementation, I can help with code review and provide some insights, suggestions and knowledge about possible pitfalls. Maybe in the future rde will be able to migrate to guix home services. > I feel that perhaps, contrary to what I thought, we hadn=E2=80=99t reache= d a > shared understanding of what it means to maintain things collectively > withing Guix. It=E2=80=99s a bit of a sad situation, but I=E2=80=99m sur= e there=E2=80=99ll > still be good things happening in Guix Home, and in rde. I try to upstream everything I can, to make everyone in Guix community be able benefit from it and also to make a code benefit from collective maintenance in Guix repo. BTW, sending you a lot of kudos for improving guix home and symlink-manager code. Resending this email to keep public record of it. (It was declined by debbugs cause issue was archived). --=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name=signature.asc Content-Transfer-Encoding: base64 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRSkRCQUVCQ2dBdEZpRUVLRUdheGxBNGRF REg2Uy82SWdqU0NWakIzckFGQW1JdGt1d1BIR0Z1WkhKbGQwQjAKY205d0xtbHVBQW9KRUNJSTBn bFl3ZDZ3YXQ4UC9SOW1wTytsWHVJQ2JpT0Y3M29sb1FJR0ZEYk13ZHRVQkJ0VwoyM3VyOFhWckpQ Vkx3bnUyakltK1dmVFZqWURjc0F0eTlpTUxyaEtTTHdENFF0d2FPUml2dkRnSU40L01wMVhJCjBE RXNRME05T0J5Unl4dE1kY2tIcGFtN2w4ZE0wVHJWSnBYelhqNzlIQzErVHlPQzczWUlmSERrNW15 K05wcWMKSHk3RkQ5ODRadmkvK3VYQjhBblY0VlZJU2NHaENQK2FMZEpkTy9MelVRdVd6MU52cmdC UVVnOGNacitVaFY5VApCeXVZZTI2aU0xVmRKS0NJVUpKWTV1WEJVZnJNVkRVbnBFT21CZjdOWlZQ TkNDZjJoZHJHQWtLdmlIdkhMUGJuCkpKR2FhNlpNN0xvdjF4SFBjdWx4TldxUzIzWlJOc01IcGZp eUo0aTNyaE81RG40d0E4WVRiYzZaZWIxdHNSQ1AKRnRwZzUyQVRSRU1XOUJQRGdodFgxdFhKS2ZY NEdueXRrV0toNWw0MFJjNVpMUm5GZ0xCeStrdGlCYk1mQzJHVQp4bXA5eHVESkhYcWhTWVNKRVFv YkFlN2Z2K2ZHWWJYNWUwOENYbWgydHJRVGxZeHpIR2g5cTBKUFljK1NjSG15CmVPYUJIV2FWVDZE enMxd05qN2ZCL3NpYUZSSFF2OFQ1dlFxNVk1QUJPaU9sKzdqVEYwOXVVdzdibDZwWndFbzAKUlZ6 Um5iZ0lLTUM5Z3FXcHpzcjF5Y0RaZlFZVkxXM0FKazUwTU9wZnRLd25xbFgzb2U1MUVSNjkweHo2 Y0x4TQpud21jd3N5ZUxlNnNEZVRhK0IxbnVOY2c0RGVIUjU2YnZlRjhDQVRKZ01sOGFDZXFDWWhm YTJCTGZsT1pLV042ClE2VUF1SnhDCj1iaEhQCi0tLS0tRU5EIFBHUCBTSUdOQVRVUkUtLS0tLQ== --=-=-=-- From unknown Wed Jun 18 23:18:05 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 10 Apr 2022 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator