From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id qJFcGQ/32mCJ0wAAgWs5BA (envelope-from ) for ; Tue, 29 Jun 2021 12:33:51 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 4K8oFQ/32mBLSwAAB5/wlQ (envelope-from ) for ; Tue, 29 Jun 2021 10:33:51 +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 7B9DF1D3E9 for ; Tue, 29 Jun 2021 12:33:50 +0200 (CEST) Received: from localhost ([::1]:44548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyB3t-00032y-Hl for larch@yhetil.org; Tue, 29 Jun 2021 06:33:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyB3Y-00032n-RO for guix-devel@gnu.org; Tue, 29 Jun 2021 06:33:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50162) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyB3X-0003y0-Lu; Tue, 29 Jun 2021 06:33:27 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=42530 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyB3X-0007aD-Dl; Tue, 29 Jun 2021 06:33:27 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Xinglu Chen Subject: Re: Early feedback on Guix Home References: <87tuloyb6n.fsf@gnu.org> <87y2azr86k.fsf@yoctocell.xyz> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 11 Messidor an 229 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, 29 Jun 2021 12:33:26 +0200 In-Reply-To: <87y2azr86k.fsf@yoctocell.xyz> (Xinglu Chen's message of "Thu, 24 Jun 2021 10:14:11 +0200") Message-ID: <87fsx1t0y1.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-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 , Andrew Tropin 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=1624962830; 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; bh=bFcRn2oA2U5OyhKLIgN2HLi6J69NuEQvw1NxCD/qMu0=; b=QkzGOibhJCpiSzY1Ji6tT16AJgw8+lNmzEe1pQCgF5Sg9xmrdZ+dYLcyTt+kxLQ6ZIKwa0 wbClxUDmIdKdqFOwnWwRge/UAeugWRD9AJug+/zrfc2WbPtfLTeUaui2EEeW+YAHiwQrKm 0vLeR4ISWkzCaJfXyJ8NUoup6DTP3X5mrpEFU3rbBdJQFlo0hnOP1d1r0JcjoEhAr7PR88 gqLossGqXZoDRmKYAN3pS8K3k/2M9mBqUJfCyYR3cg6H/PQuTL52B1l1tkodkk8Ze6KrU1 YWHhDcd5xDlcfijbWgOG3KCrhmtjFzJV9txM4X8dK3j4pLbzaX1Waz8DXkvi7g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624962830; a=rsa-sha256; cv=none; b=Pf1B8oXfR/lq1P2UCNmfV1M0uNOTelD+hlnag8lwzwETRkZEc4MR1t6HGUxhzeyIAW7CRN KJ5fcOI0WytwvLpcVDnrDkLd/elHpWbuAy7AxTQLRdCbM389s3ViNPhMYffXfhpD3TcbXv 6XL1TbC+8R8Y4KBu/ETOk8BDjYGQuOaRkFQPqvUinGakL75/SUz8CvTUIjc8bp/3nM0JMj ko/u0o+MkGTpaI+goBVXd+qzF6rs8KqzSJWeoo61tGoHe3y+QgUXi9GmoyNlF+AFRZr3Qv 86hxE5UXbAyvHUfGTphTUu6naq+FC1h0R+ac7uJK6LgsPtVjOnkMIFNwKRlK/Q== 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-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -1.42 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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: 7B9DF1D3E9 X-Spam-Score: -1.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: jiLowHVTGHIW Hi, Xinglu Chen skribis: > On Wed, Jun 23 2021, Ludovic Court=C3=A8s wrote: [...] >> 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 car= eful about >> creating backups of any files it was going to overwrite, and it was also >> explicitly saying what it=E2=80=99s doing. Perfect. > > Yeah, the output is pretty verbose, which is good if someone is just > getting started with it, but there should probably also be an option to > make it less verbose. Yes. Also, we=E2=80=99ll have to make sure it=E2=80=99s internationalized. >> I see two possible improvements: >> >> 1. Make the manual very upfront about that: don=E2=80=99t be afraid, c= onfig >> files are backed up at that location, etc. > > Yeah, the manual needs some more work, maybe we should add an =E2=80=98mi= grating > to Guix Home=E2=80=99 section? That=E2=80=99s a good idea. >> 2. Review =E2=80=98symlink-manager.scm=E2=80=99 and work on simplifyin= g it to make it >> easier to understand what=E2=80=99s going on. >> >> 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 t= o begin with. >> >> Unfortunately, even =E2=80=98home-ssh-service-type=E2=80=99 was difficul= t to handle: I >> have a long =E2=80=98.ssh/config=E2=80=99 file and I wasn=E2=80=99t goin= g to turn that into >> =E2=80=98ssh-host=E2=80=99 lines by hand. > > There is a =E2=80=98home-generic-service=E2=80=99 procedure that allows o= ne to install > packages in dump a file somewhere in their home directory. > > (home-generic-service > 'ssh-config > #:packages (list openssh) > #:files `(("ssh/config" > ,(local-file "/path/to/some/ssh/config")))) Neat. >> Possible actions: >> >> 1. Provide a =E2=80=98guix home init=E2=80=99 command (or similar) tha= t creates an >> initial Home config based on existing config. > > As Andrew mentioned, I recently added a =E2=80=98guix home import=E2=80= =99 command, but > in only imports the installed user packages. Creating configurations > for the packages would require a lot more work, unless we just read the > contents of ~/.bashrc and ~/.config/git/config and use > =E2=80=98home-generic-service=E2=80=99 and =E2=80=98plain-file=E2=80=99, = instead of using > =E2=80=98home-bash-configuration=E2=80=99 and =E2=80=98home-git-configura= tion=E2=80=99. For SSH, generating something like: (service home-ssh-service-type (home-ssh-configuration (toplevel-options `((include . ,(local-file "ssh.conf")))))) should be doable. But yeah, we=E2=80=99ll have to see on a case-by-case ba= sis what can be achieved. >> 2. In some cases, such as OpenSSH, provide converters from the native >> format to its Scheme equivalent (maybe?). > > That would require a lot of work; we would have to parse all sorts of > weird configuration formats, not to mention that the upstream > configuration format can change in the future. It would be nice to > have, but I don=E2=80=99t think it should be a blocker for merging Guix H= ome. Agreed. >> 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. > > Since we already have the =E2=80=98home-generic-service=E2=80=99 helper, = I am not sure > if explicitly providing an escape hatch for every single service is > worth it. I feel like the point is to use Scheme to configure things, > and not to just concatenate big opaque strings. People who haven=E2=80= =99t > re-written their configs in Scheme can always use > =E2=80=98home-generic-service=E2=80=99. =E2=80=98home-generic-service=E2= =80=99 is also useful if say > the user wants to configure Mpv, but there is no Mpv service in Guix > Home. Yeah, =E2=80=98home-generic-service=E2=80=99 helps a lot, I didn=E2=80=99t = know about it. Overall, I think what I=E2=80=99m saying is that we should offer a smooth a= nd gradual transition for enthusiasts (like me!) who=E2=80=99re willing to swi= tch but can=E2=80=99t just be expected to rewrite all their config at once. >> 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=98loca= l-file=E2=80=99). See for >> example how =E2=80=98tor-configuration->torrc=E2=80=99 does it. > > Yeah, there is a =E2=80=98slurp-file-gexp=E2=80=99 procedure that let=E2= =80=99s one read an > extenal file, but using existing APIs like =E2=80=98local-file=E2=80=99 i= s probably a > better idea. Yes, it feels more natural. Also, =E2=80=98slurp-file-gexp=E2=80=99 return= s a gexp (a code snippet), but as a user you don=E2=80=99t know where that snippet is g= oing to be inserted; it may not work in some contexts. Thanks! Ludo=E2=80=99.