From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id +zYBDc0a1GD2WQAAgWs5BA (envelope-from ) for ; Thu, 24 Jun 2021 07:40:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id aK8mCM0a1GD+fgAAB5/wlQ (envelope-from ) for ; Thu, 24 Jun 2021 05:40:29 +0000 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 8322429D4A for ; Thu, 24 Jun 2021 07:40:28 +0200 (CEST) Received: from localhost ([::1]:43616 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwI6F-0007hN-1y for larch@yhetil.org; Thu, 24 Jun 2021 01:40:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwI5y-0007h5-IY for guix-devel@gnu.org; Thu, 24 Jun 2021 01:40:10 -0400 Received: from mail-lj1-x22a.google.com ([2a00:1450:4864:20::22a]:36762) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lwI5v-00029F-Sd for guix-devel@gnu.org; Thu, 24 Jun 2021 01:40:10 -0400 Received: by mail-lj1-x22a.google.com with SMTP id a16so6105725ljq.3 for ; Wed, 23 Jun 2021 22:40:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-transfer-encoding; bh=0oopmaTMtN7L5vDRGDm/P9p7JLnc1LKDQcFWyTK8jjw=; b=hnHfzK6a40maFx/i6v3u/9FD3zl7aNYww9VYg8GKruDsHi8k1EbLzvjkPUeDdDXfux 1fCSVouDSqMOAA1c+3/wY2hSqeGrM8EHz6JluaLm76v+78yxRa6zSROxDZ8xYs7VsvIX NRobGlUCJFUFVo05J52QNIjpvweipgdPm89wWxoqKNkl1Zfc7IEn6m47QSKYLhIwnIxf jbrnDDjMRYSjVAB0cbYaK4vsPGn5ptYvNYZfanmDvorPM7BcNkrYr6lL+FdHmGwpoJmC ac4P8XKkpelFs9w6Lmjw7KY5fMZdNth/c9RrH0/JGCUpqp8vAcG3qHeuTTWij1/EI6V4 IjVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=0oopmaTMtN7L5vDRGDm/P9p7JLnc1LKDQcFWyTK8jjw=; b=fX6U2w4nnQamA/b06Y8vo35W8XZV0Bu99EnzTAeaYghiTlhHT+M/EMm9ekHtom/AHA bzPNT5afSBEtwoFiGN2hhfzpvbSpPcuNe3s1jWSpLfsxCa9yxiowlwP5ppXaFHHjXjjp 5Gn4cmAz5bpvOyoBs2vPtKT8z4XI5gxWENq15MmF1Rl51Ov+GDgM+NjM9iNPWOmYGpSb Afml8XKXG+nVQe4uADKeUpIAkbB0PwNt91fysjavIOZYeRoLeWxW0FXAYeZjWWU+cAUm 21Mpx7njxAPNQOWVnCM8OKo/Fwqd3bVV+13vWoZaoZerZz1nBgmIMktc2RHSjypywsBW qH5Q== X-Gm-Message-State: AOAM5339nbap+EKNqaS5UGW/cUwAcaCcJ4AZrwVY69wc6QZujblYcGSc 7YzPpKYXnlOfwOTwaTeQRaRz6pjwwedJSA== X-Google-Smtp-Source: ABdhPJx+3b8gi+7kne/20YJL6cs/Q15eObXH9ZdMUIM6rKrSy4MnX40RNH0sstRP1f8j7Yove1DsxA== X-Received: by 2002:a2e:8146:: with SMTP id t6mr554277ljg.364.1624513205496; Wed, 23 Jun 2021 22:40:05 -0700 (PDT) Received: from ixy ([109.252.117.164]) by smtp.gmail.com with ESMTPSA id r7sm181032ljc.113.2021.06.23.22.40.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Jun 2021 22:40:04 -0700 (PDT) From: Andrew Tropin To: Ludovic =?utf-8?Q?Court=C3=A8s?= , Xinglu Chen Subject: Re: Early feedback on Guix Home In-Reply-To: <87tuloyb6n.fsf@gnu.org> References: <87tuloyb6n.fsf@gnu.org> Date: Thu, 24 Jun 2021 08:40:03 +0300 Message-ID: <877dijom6k.fsf@trop.in> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: none client-ip=2a00:1450:4864:20::22a; envelope-from=andrew@trop.in; helo=mail-lj1-x22a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624513228; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=0oopmaTMtN7L5vDRGDm/P9p7JLnc1LKDQcFWyTK8jjw=; b=b1kgvkAvhjJqwzNJbqEZZLS2KlF4n6Q9eLuAK7V3tKeXi4PFPf5sGiDE3d29iUCl3XEH1c AoLD9EV3MMIJHBZClEI75q9lUWJRXlGW1VKpgB8l4f4Lf9WLdW4nvHGBTxKoVTjfdiUMFk FLP21JSCi23GeqdZeuM12vB0GPU0HTL+2o4QYd6IgLiDyZF0H17clVxgS05JfaE1duC2DS yGWaSdb8z0HR3lrwztnFBjHsAzQYfyHiVG6YwzJm/qV/8Tp/Uu/rYnlFwaIA2n8oKvhJLd rCb4FYD2H+9n07Al/8MwDrCh6SSpqvnu6WiQZIjytxTnrkVIlDveTHlNB9upTw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624513228; a=rsa-sha256; cv=none; b=UQXxEepzTbLk+FPOaLUeMgAjHCrFg8OKpmvDAYt1N2yvDYI4o4KHWZHg679E3wKtcOta8h MSC6J+t/PuHFD4apuGYxtOxvus0Gp5VbKJA12wE23rDHIx/7JaQv++lDON415VDNHZoQZD F7KrH1Je3eT4f6sOR+ni+am02FqKYEvroKGd0+OPPRMgJNkkn29Fw+44P/sqCpzUyJU8Rv MmJw4lJHvcFB9S6AMsu6mxnZegR7WnKfswQMS1pnxtETixHDYpZQCgsQrz3vIs59GLLidS 0B/AJUOduwNI+wEIPtGqEBmSYPOdF72hRHLUlqlHsmuoU0kCOyIe3M5oMaEw7w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=trop-in.20150623.gappssmtp.com header.s=20150623 header.b=hnHfzK6a; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -1.13 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=trop-in.20150623.gappssmtp.com header.s=20150623 header.b=hnHfzK6a; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 8322429D4A X-Spam-Score: -1.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: ca62mwHYPh51 Ludovic Court=C3=A8s writes: > Hello! > > As discussed on IRC a few days ago, I finally gave Guix Home a try and I > like it! > > I thought I=E2=80=99d share my first impressions so we can try and addres= s them > in the process of getting it merged. > > First, I think one of the main reasons why it took me so long to try it > out is that I was afraid of what would happen at =E2=80=9Cactivation time= =E2=80=9D (upon > reconfigure). Were my dot files going to be deleted? If so, which ones > exactly should I back up? That led me to look more closely at the code > to better understand what was going to happen. Good to know, added a todo to make it clearer in the documentation. > I found =E2=80=98symlink-manager.scm=E2=80=99, which is what I was lookin= g for, but > that code is fairly complex. Yep, perhaps it a little monstous) Maybe cleaning it up is a good idea before sending the patch to guix. > Anyway, I backed up a bunch of files :-) and eventually gave it a try, > just to notice that =E2=80=98guix home reconfigure=E2=80=99 was very care= ful about > creating backups of any files it was going to overwrite, and it was also > explicitly saying what it=E2=80=99s doing. Perfect. > > I see two possible improvements: > > 1. Make the manual very upfront about that: don=E2=80=99t be afraid, co= nfig > files are backed up at that location, etc. > > 2. Review =E2=80=98symlink-manager.scm=E2=80=99 and work on simplifying= it to make it > easier to understand what=E2=80=99s going on. Sounds reasonable) > Second, the other thing that stopped me from getting started is the > initial config. How could I move from all my undisciplined dotfiles to > the single explicit config? Eventually, I found that starting with > nothing but packages, =E2=80=98home-bash-service-type=E2=80=99, and > =E2=80=98home-ssh-service-type=E2=80=99 was the most reasonable option to= begin with. > > Unfortunately, even =E2=80=98home-ssh-service-type=E2=80=99 was difficult= to handle: I > have a long =E2=80=98.ssh/config=E2=80=99 file and I wasn=E2=80=99t going= to turn that into > =E2=80=98ssh-host=E2=80=99 lines by hand. > > Possible actions: > > 1. Provide a =E2=80=98guix home init=E2=80=99 command (or similar) that= creates an > initial Home config based on existing config. Xinglu implemented `guix home import`, which creates a simple home-environment configuration, which contains the same packages as ~/.guix= -profile > 2. In some cases, such as OpenSSH, provide converters from the native > format to its Scheme equivalent (maybe?). It's a good idea and Xinglu also mentioned it, but I find it to be a lot of extra work, so I propose to postpone it until next time, IMO it's better to focus on moving Guix Home from rde repo first in the current state and add new functionality after that step is done, otherwise we can stuck with wip-guix-home for months. > 3. For each service, provide an escape hatch: a way for users to > provide a raw config file. We do that for all or most of the Guix > System services, and it helps a lot when people are starting from > an existing config. We do it as well, the only difference is that we try to utilize target program capabilities or slurp-file-gexp helper for that. The first one means that target configuration format allows to use some directive to load the content of another file: https://git.sr.ht/~abcdw/rde/tree/master/gnu/home-services/ssh.scm#L190 https://git.sr.ht/~abcdw/rde/tree/master/gnu/home-services/emacs.scm#L200 The second one inlines the content of file directly in configuration. In most cases it's done by providing a gexp, which reads the content of the file in the store and returning its content as a string to make mixed-text-file to add it to the target configuration. https://git.sr.ht/~abcdw/rde/tree/master/gnu/home-services/emacs.scm#L208 > In terms of API, I noticed that in places such as > =E2=80=98home-bash-configuration=E2=80=99, config snippets are represente= d as a list of > strings (internally passed to =E2=80=98mixed-text-file=E2=80=99). That f= orces users to > mix different languages in their .scm file=E2=80=94e.g., half of my Home = config > is .bash{rc,_profile} snippets embedded in Scheme strings. That=E2=80=99s > inconvenient. Can you elaborate on that please, ideally with some examples. > Possible action: > > 1. Change config records to accept file-like objects instead of > strings. That way, users can choose to have snippets inlined (in a > =E2=80=98plain-file=E2=80=99 object) or separate (via =E2=80=98local= -file=E2=80=99). See for > example how =E2=80=98tor-configuration->torrc=E2=80=99 does it. > > That=E2=80=99s it. I hope it makes sense to you! Make a lot of sense, thank you for the feedback and suggestions!) > I encourage everyone to give it a spin, fearlessly! > What I did was (roughly): > > git clone https://git.sr.ht/~abcdw/rde > guix git authenticate \ > "257cebd587b66e4d865b3537a9a88cccd7107c95" \ > "2841 9AC6 5038 7440 C7E9 2FFA 2208 D209 58C1 DEB0" \ > -k origin/keyring And to get the initial configuration, it's a good idea to take a look at gnu/home/examples directory or call import action: ./pre-inst-env guix home import > /path/to/home-config.scm > ./pre-inst-env guix home reconfigure /path/to/home-config.scm For people, who is not yet familiar with Guix Home, the project and documentation web pages: https://sr.ht/~abcdw/rde/ https://guix-home.trop.in/Home-Configuration.html#Home-Configuration