From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id cER8MxQ4AWKuiwAAgWs5BA (envelope-from ) for ; Mon, 07 Feb 2022 16:17:40 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 2PalMBQ4AWJTPQEA9RJhRA (envelope-from ) for ; Mon, 07 Feb 2022 16:17:40 +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 7E10C1DDF8 for ; Mon, 7 Feb 2022 16:17:38 +0100 (CET) Received: from localhost ([::1]:35516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nH5lp-0007tb-KM for larch@yhetil.org; Mon, 07 Feb 2022 10:17:37 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nH5lG-0007rZ-HY for guix-patches@gnu.org; Mon, 07 Feb 2022 10:17:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49339) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nH5lG-00079t-7L for guix-patches@gnu.org; Mon, 07 Feb 2022 10:17:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nH5lG-0000gj-2m for guix-patches@gnu.org; Mon, 07 Feb 2022 10:17:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53466] [PATCH] home: Add redshift service. Resent-From: Andrew Tropin Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 07 Feb 2022 15:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53466 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 53466-done@debbugs.gnu.org Received: via spool by 53466-done@debbugs.gnu.org id=D53466.16442469912604 (code D ref 53466); Mon, 07 Feb 2022 15:17:02 +0000 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 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-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=1644247058; 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:resent-cc: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: dkim-signature; bh=guSz5YOb0zWOny81p5CngaRsHeaUDUddBX6k1P+V+TA=; b=GoN8Vj0Iy2qaNmPPGNK8HNEL8O0mh6zXiPfnOcJet7mXShDRxUnOCSgX+8dwly7hyWl9zE Bn5oOhUe6oqtC+rZ0XICN1NGU+smL+R1SCyy0HcBr0+Jyxl3K0gqH65e1HJx1aAxw+S3Tv /OQfXyf7wQo6dqGb9oRQsy4bzeOg4rJ0vyCnsGmNXO58XmAsgWCGQPXaNFENG2oKLZBWCV W0XIR5XioNfchLrZIizCYwFODQb8da7LVSN8jAQm1haRkSRc4nURDZ0hFZBPl91gpK0T2E hTx46PKFvEcw3qRH64x0ggIthy+fuqeP19um6TbQeShO78NTET/btxjzPrjJIA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644247058; a=rsa-sha256; cv=none; b=gUwA/0as2NVsZhez4hqNCO3z42FIta8YGSupSB+fwbsL3QS03CfI0m6jXRlFMDG/3IXBTV qDz5OO6J8AfMXrBWjuOaloFVO3x9imJAqiruuUJhhMUwjctXHBYROvIqdG8cX+xAwyhV6C kb2UJs59AUtQpbUoiLSjW5jPeQPNlkZn2DOyps+e/Nx3cghRyEaGm6azNNK56sJy+PO3bP umD2iwiSgm8dpT94w+aQyp8kS2DWitWiB5sMLUm71XH+trflFIoZlBia+aSc6+mazQATZC ZANwhVCX5Ak+8P/MLzOn2ZFd+y+PUfj0PZofw5oSA868DoezaB2ZYhZ01E8nYw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop-in.20210112.gappssmtp.com header.s=20210112 header.b=FkuwETec; dmarc=none; 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: -4.73 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=trop-in.20210112.gappssmtp.com header.s=20210112 header.b=FkuwETec; dmarc=none; 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: 7E10C1DDF8 X-Spam-Score: -4.73 X-Migadu-Scanner: scn0.migadu.com X-TUID: tub3QMymRUOw --=-=-= 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----- --=-=-=--