From: Andrew Tropin <andrew@trop.in>
To: "Ludovic Courtès" <ludo@gnu.org>, "Xinglu Chen" <public@yoctocell.xyz>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Early feedback on Guix Home
Date: Wed, 30 Jun 2021 09:10:55 +0300 [thread overview]
Message-ID: <87a6n751cg.fsf@trop.in> (raw)
In-Reply-To: <87fsx1t0y1.fsf@gnu.org>
Ludovic Courtès <ludo@gnu.org> writes:
> Hi,
>
> Xinglu Chen <public@yoctocell.xyz> skribis:
>
>> On Wed, Jun 23 2021, Ludovic Courtès wrote:
>
> [...]
>
>>> Anyway, I backed up a bunch of files :-) and eventually gave it a try,
>>> just to notice that ‘guix home reconfigure’ was very careful about
>>> creating backups of any files it was going to overwrite, and it was also
>>> explicitly saying what it’s 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’ll have to make sure it’s internationalized.
>
>>> I see two possible improvements:
>>>
>>> 1. Make the manual very upfront about that: don’t be afraid, config
>>> files are backed up at that location, etc.
>>
>> Yeah, the manual needs some more work, maybe we should add an ‘migrating
>> to Guix Home’ section?
>
> That’s a good idea.
>
>>> 2. Review ‘symlink-manager.scm’ and work on simplifying it to make it
>>> easier to understand what’s 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, ‘home-bash-service-type’, and
>>> ‘home-ssh-service-type’ was the most reasonable option to begin with.
>>>
>>> Unfortunately, even ‘home-ssh-service-type’ was difficult to handle: I
>>> have a long ‘.ssh/config’ file and I wasn’t going to turn that into
>>> ‘ssh-host’ lines by hand.
>>
>> There is a ‘home-generic-service’ procedure that allows one 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 ‘guix home init’ command (or similar) that creates an
>>> initial Home config based on existing config.
>>
>> As Andrew mentioned, I recently added a ‘guix home import’ 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
>> ‘home-generic-service’ and ‘plain-file’, instead of using
>> ‘home-bash-configuration’ and ‘home-git-configuration’.
>
> 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’ll have to see on a case-by-case basis
> 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’t think it should be a blocker for merging Guix Home.
>
> 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 ‘home-generic-service’ 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’t
>> re-written their configs in Scheme can always use
>> ‘home-generic-service’. ‘home-generic-service’ is also useful if say
>> the user wants to configure Mpv, but there is no Mpv service in Guix
>> Home.
>
> Yeah, ‘home-generic-service’ helps a lot, I didn’t know about it.
Will mention it in the manual.
> Overall, I think what I’m saying is that we should offer a smooth and
> gradual transition for enthusiasts (like me!) who’re willing to switch
> but can’t 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
>>> ‘plain-file’ object) or separate (via ‘local-file’). See for
>>> example how ‘tor-configuration->torrc’ does it.
>>
>> Yeah, there is a ‘slurp-file-gexp’ procedure that let’s one read an
>> extenal file, but using existing APIs like ‘local-file’ is probably a
>> better idea.
>
> Yes, it feels more natural. Also, ‘slurp-file-gexp’ returns a gexp (a
> code snippet), but as a user you don’t know where that snippet is going
> to be inserted; it may not work in some contexts.
Acually, the idea behind `slurp-file-gexp` is that you always know where
it will be inserted, because it will be inside the specific section of
the configuration. Take a look at emacs home-service example:
https://git.sr.ht/~abcdw/rde/tree/master/item/gnu/home-services/emacs.scm#L91
I'll explain it in more details in the manual.
Correct me, if I missunderstood your point.
next prev parent reply other threads:[~2021-06-30 6:11 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-23 13:15 Early feedback on Guix Home Ludovic Courtès
2021-06-24 5:40 ` Andrew Tropin
2021-06-29 10:25 ` Ludovic Courtès
2021-06-24 8:14 ` Xinglu Chen
2021-06-24 15:18 ` Andrew Tropin
2021-06-29 10:33 ` Ludovic Courtès
2021-06-30 6:10 ` Andrew Tropin [this message]
2021-07-10 14:18 ` Ludovic Courtès
2021-07-20 11:01 ` Andrew Tropin
2021-07-04 13:21 ` Xinglu Chen
2021-06-24 16:50 ` jbranso
2021-06-24 17:42 ` Andrew Tropin
2021-06-24 18:42 ` Leo Prikler
2021-06-25 7:03 ` Andrew Tropin
2021-06-25 4:13 ` Joshua Branson
2021-06-25 7:17 ` Andrew Tropin
2021-06-25 18:08 ` Early feedback on Guix Home and a basic almost complete sway service Joshua Branson
2021-06-30 6:03 ` Andrew Tropin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a6n751cg.fsf@trop.in \
--to=andrew@trop.in \
--cc=guix-devel@gnu.org \
--cc=ludo@gnu.org \
--cc=public@yoctocell.xyz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).