unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tanguy LE CARROUR <tanguy@bioneland.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: Contributing Guix Home services
Date: Wed, 17 May 2023 09:16:06 +0200	[thread overview]
Message-ID: <168430776698.8114.12478286933255777435@localhost> (raw)
In-Reply-To: <87pm7hxi30.fsf@gnu.org>

Hi Ludo’,

Sorry, busy week! 😅 … euh… busy 2 weeks! 😱


Quoting Ludovic Courtès (2023-05-03 22:42:27)
> Tanguy LE CARROUR <tanguy@bioneland.org> skribis:
> 
> > Quoting Ludovic Courtès (2023-04-17 15:39:02)
> >> Tanguy LE CARROUR <tanguy@bioneland.org> skribis:
> >> > It's been quite a journey on my side! Ups. Downs. Mostly downs, though! 😅
> >> > Thanks to Simon's unconditional technical and moral support, a **LOT**
> >> > has changed since I sent this message. Hopefully for the better! 🤞
> >> 
> >> Heh.  :-)  While it’s fresh on your mind, it would be nice to list the
> >> problems you ran into on your journey and see what we can do about it.
> >
> > Mostly figuring out how to test it!
> >
> > On my machine at home, `guix home reconfigure` can take minutes.
> 
> Did you test with ‘guix home container’ first?  That’s what I do and I
> added this command precisely so one can test without any risk of
> breaking things.
> 
> It’s still too slow though, that’s right.

Yes, when I use my actual home config, it also takes minutes to build
the container, but, if I use a fake home config, limited to the service
I want to test, it's way faster! Still slower than the following…

Append this test code at the end of the service file:

```scheme
(define configuration
  (home-service-configuration
   ; […]
  )

(mixed-text-file "test" (serialize-configuration configuration home-service-configuration-fields))
```

Then, from the command line:

```console
$ cat (guix build -f path/to/home/service.scm)
# … the content of the generated file
```


> > I can only test file generation, though.
> 
> The msmtp service does nothing but file generation though, right?
> 
> > Then I painfully discovered that replacing in a string is not as easy as
> > it sounds, or, more precisely, that "python replace in string" yields
> > better results than "scheme replace in string" in DuckDuckGo!
> 
> True!  Perhaps something to add to the Cookbook’s Scheme intro.
> 
> (Fun fact: I’ve never used that (ice-9 string-fun) module that keeps
> popping up in new code.  :-))

Whaaaat?! 🤯 How one would you do without it? 😅


-- 
Tanguy


      reply	other threads:[~2023-05-17  7:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-25 16:53 Contributing Guix Home services Tanguy LE CARROUR
2023-04-04  7:45 ` Tanguy LE CARROUR
2023-04-13 20:42   ` Ludovic Courtès
2023-04-14 12:03     ` Tanguy LE CARROUR
2023-04-17 13:39       ` Ludovic Courtès
2023-04-20 15:28         ` Tanguy LE CARROUR
2023-05-03 20:42           ` Ludovic Courtès
2023-05-17  7:16             ` Tanguy LE CARROUR [this message]

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=168430776698.8114.12478286933255777435@localhost \
    --to=tanguy@bioneland.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /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).