From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gJOxMElWAGImMgEAgWs5BA (envelope-from ) for ; Mon, 07 Feb 2022 00:14:17 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id +P0xLUlWAGJ5vwAAauVa8A (envelope-from ) for ; Mon, 07 Feb 2022 00:14:17 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 449D13A17D for ; Mon, 7 Feb 2022 00:14:17 +0100 (CET) Received: from localhost ([::1]:40364 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nGqjY-0005kA-1w for larch@yhetil.org; Sun, 06 Feb 2022 18:14:16 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nGqjR-0005jk-KK for guix-patches@gnu.org; Sun, 06 Feb 2022 18:14:09 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:46315) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nGqjK-0002Zc-9c for guix-patches@gnu.org; Sun, 06 Feb 2022 18:14:09 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nGqjK-0002d5-6U for guix-patches@gnu.org; Sun, 06 Feb 2022 18:14:02 -0500 Subject: bug#53466: [PATCH] home: Add redshift service. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Sun, 06 Feb 2022 23:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 53466 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Andrew Tropin Cc: 53466-done@debbugs.gnu.org Mail-Followup-To: 53466@debbugs.gnu.org, ludo@gnu.org, ludo@gnu.org Received: via spool by 53466-done@debbugs.gnu.org id=D53466.164418920710032 (code D ref 53466); Sun, 06 Feb 2022 23:14:02 +0000 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= 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: / 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644189257; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-to: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=341JYskA9QW9yAmO03844mjbojdN06vcF6mzAQgWoqg=; b=Hg5So/tFZN27kCcbqhlh+XoiF6DX5IbkqrbNyKmgj0VzEjG2PeNzkSL/kZhiTL9D77CXgC 65KoTuSextsRlLLHKmN8CoXhUhF69NqiYu/8tNViZDdJlWAOXOh31ekB0AdYj9+9cE7ySI 5YQMYGDsDA0xENkHwFdbqImfFO1Eo6Vha6kHGf1S/AfYgPRpGPb2nVV/B2vowo9zA/Sc4p 5PItrDlpTAo4FWgzjYacuLLv42skTGVbGtkF5sygNdGBp5p5zZfPL8f7P0YJ5rDZcNXhlJ +LgqWfGtNu7kAyQjcxsb0ZEq6ot39YksAJ9ZXQdBdPUPlB7eEiEqtlz1uSkbmw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644189257; a=rsa-sha256; cv=none; b=iZ4LzT/sdUZg9Xppuuk0oOYCT/587Z6tf85I3dB3t0aWaVaK98BbzF+kyomZgku1A7heFp 3sA9fS6w3PVBOdVxujgyWmIHwgr1pik+qGwERJmS+KTzlG0bJYsd1b1V9dk1C4UYbe5X/K R7TgDSYAPPvjUdmAeU/idmgNii4pPSVmQ2Ax7xZXYt9BbHcNEYOiIo73Hj6+vjjN8ORZs/ L8ShX+HHrReFsU2Tw+ObvpGZM7Az+PsEMrD9eV89WeEWNrZ1E2MR0x1uzVqlwrumfbTIri fWhp8RlrXYk8Yv+iDtjCmwXsdPNg4eBu6rq3SCEHx/36Jrcg0eQ9AE/De8/j/A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.93 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 449D13A17D X-Spam-Score: -3.93 X-Migadu-Scanner: scn0.migadu.com X-TUID: LHlZtFBRJ3VP 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.