unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: "Andrew Tropin" <andrew@trop.in>,
	guix-devel@gnu.org, "Oleg Pykhalov" <go.wigust@gmail.com>,
	"Ludovic Courtès" <ludo@gnu.org>
Cc: Xinglu Chen <public@yoctocell.xyz>, guix-maintainers@gnu.org
Subject: Re: Return back original implementation for text-config serialization
Date: Mon, 10 Jan 2022 21:12:31 +0100	[thread overview]
Message-ID: <25ad4a52f0de315048670dbad61ebede8fc0a681.camel@gmail.com> (raw)
In-Reply-To: <87mtk33oou.fsf@trop.in>

Am Montag, dem 10.01.2022 um 12:49 +0300 schrieb Andrew Tropin:
> [T]he whole point of escape hatch is to make it possible to reuse
> existing files directly without any manipulation on them and importer
> should demonstrate how to do it.
That'd make more sense if the importer copied bashrc to some well-known
location (e.g. ~/.config/guix/data/.bashrc) and then used that rather
than the file it wishes to replace.  IIRC that was one suggested
behaviour of Guix Home in the past, but it didn't get approval because
users wouldn't typically ask for that copying to happen.  If you make
it so that plain-file is used normally, but add a switch to express
things in terms of local-file instead, that'd work.  

OTOH, I do think local-file is already well-documented on its own, so
perhaps it'd only take a cookbook entry to show it in combination with
Guix Home and an explanation as to why Guix Home doesn't do that
normally while explaining all the caveats.

> If importer internally do some manipulation (escaping) with the
> content of the file and places the result in the string in scheme
> file, user won't be able to replicate such process easily for other
> services, which not covered by the importer. If I understood
> correctly what you meant in the first message.
Yes, the user would have to manually quote every new line of code
they're adding, but they're free to use all other file-like objects,
including local-file.  Having (bashrc (local-file ".bashrc")), whether
implemented on top of slurp-file-gexp or not, is inherently dangerous,
though.

> > The point I'm making is that we shouldn't swap out one bad
> > abstraction for another, but pave the road towards good
> > abstractions, e.g. G-expressions in the way the rest of Guix
> > typically uses them.
> 
> Actually, for me, the original implementation looks consistent with
> how the rest of Guix treats G-expressions (uses already known
> abstraction) and only new one intoduces a new abstraction.
That's the point.  The old style works just like you'd expect it to, it
becomes a problem when you try to feed it stuff like slurp-file-gexp to
work around some limitations in a way I'm not convinced makes sense.

> [I]t's already possible to achieve the same [-- merging multiple
> bashrc snippets into a single file --] with gexps/file-like in both
> new and old text-config implementations.
I find the lack of services in your example concerning, but I'll take
your word for it.  In that case, using a gexp for bashrc in the typical
sense is probably the best idea, but we still need to do something with
the reliance on slurp-file-gexp.

Cheers

> 
PS:
> It's offtopic, but when you will have time please take a look at
> https://issues.guix.gnu.org/52388.
Hahaha, it's been a month, hasn't it?  There's some aesthetic
unpleasanties, so I'm not sure if I'll upstream it with slight
stylistic changes or give you some harsher feedback, but I'll try to
decide this weekend.



  reply	other threads:[~2022-01-10 20:12 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-09  9:12 Return back original implementation for text-config serialization Andrew Tropin
2022-01-09 11:19 ` Liliana Marie Prikler
2022-01-09 17:48   ` Andrew Tropin
2022-01-09 19:44     ` Liliana Marie Prikler
2022-01-10  9:49       ` Andrew Tropin
2022-01-10 20:12         ` Liliana Marie Prikler [this message]
2022-01-12 15:05           ` Andrew Tropin
2022-01-09 12:17 ` Maxime Devos
2022-01-09 12:19 ` Maxime Devos
2022-01-09 17:59   ` Andrew Tropin
2022-01-09 19:00     ` Maxime Devos
2022-01-18 14:26 ` Ludovic Courtès
2022-01-20 13:20   ` Andrew Tropin
2022-01-21  9:30     ` Maxime Devos
2022-01-26  8:34       ` Andrew Tropin
2022-01-27  5:04         ` Maxim Cournoyer
2022-01-28 15:48           ` Andrew Tropin
2022-02-05 11:09           ` Ludovic Courtès
2022-02-13 14:14             ` Andrew Tropin
2022-01-26  8:36       ` Andrew Tropin
2022-02-05 11:34         ` Maxime Devos
2022-02-13 14:09           ` Andrew Tropin
2022-01-24 15:37     ` Ludovic Courtès
2022-01-26  9:11       ` Andrew Tropin
2022-01-26  9:21         ` Andrew Tropin
2022-02-05 14:43     ` Xinglu Chen

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=25ad4a52f0de315048670dbad61ebede8fc0a681.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=andrew@trop.in \
    --cc=go.wigust@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=guix-maintainers@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).