[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Early feedback on Guix Home
From: |
Ludovic Courtès |
Subject: |
Re: Early feedback on Guix Home |
Date: |
Tue, 29 Jun 2021 12:25:21 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Hi,
Andrew Tropin <andrew@trop.in> skribis:
> Ludovic Courtès <ludo@gnu.org> writes:
[...]
>> I found ‘symlink-manager.scm’, which is what I was looking 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.
That’d be great.
>> Possible actions:
>>
>> 1. Provide a ‘guix home init’ 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
Oh nice. Currently it’s roughly equivalent to ‘guix package
--export-manifest’, which is a good start but it’d be interesting to see
if it can go beyond that.
>> 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.
Agreed, I’m not saying this should be done before the merge.
>> 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
Oh great. Somehow I had overlooked these.
IWBN to have prominent examples of these in the manual—e.g., SSH
configuration that includes a hand-written .ssh/config file.
>> In terms of API, I noticed that in places such as
>> ‘home-bash-configuration’, config snippets are represented as a list of
>> strings (internally passed to ‘mixed-text-file’). That forces users to
>> mix different languages in their .scm file—e.g., half of my Home config
>> is .bash{rc,_profile} snippets embedded in Scheme strings. That’s
>> inconvenient.
>
> Can you elaborate on that please, ideally with some examples.
Currently I have this:
--8<---------------cut here---------------start------------->8---
(service home-bash-service-type
(home-bash-configuration
(guix-defaults? #t)
(bash-profile '("\
[...]
"))
(bashrc '("
[...]
"))))
--8<---------------cut here---------------end--------------->8---
where I omitted ~30 lines of shell snippets embedded in Scheme strings.
It’d be more convenient if I could instead write:
(home-bash-configuration
(bash-profile (local-file "./bash_profile"))
(bashrc (local-file "./bashrc")))
Thanks,
Ludo’.