all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Efficient iterative shepherd service development ?
@ 2024-08-05  4:06 Nicolas Odermatt-Lemay
  2024-08-05 18:36 ` Felix Lechner via
  2024-08-07  9:05 ` Carlo Zancanaro
  0 siblings, 2 replies; 3+ messages in thread
From: Nicolas Odermatt-Lemay @ 2024-08-05  4:06 UTC (permalink / raw)
  To: help-guix

Hello Guix hackers !

I find myself spending a lot of time developing custom service types and,
being a novice in Guile, I feel like I need to add a few lines of code at a
time, test, and repeat.

So far I've been working on the new service in its own file and I added
this service in my operating-system definition. I then use `guix system
reconfigure ...' to test the service.
This workflow works but it is time consuming. It also adds a new operating
system generation at each iteration, which is unnecessary.
I also don't like the fact that I'm putting some code in my
operating-system definition that I wasn't able to test beforehand.

So I'd like to know the "Guix way", or just a more efficient way to do this
type of development. Note that I'm mostly interested in service types that
extend shepherd-service-type.

My end goal would be to call something like `(test-my-service
"path/to/service.scm")' and have it stop the service if it's running,
reload its definition according to what's in "path/to/service.scm" and
restart it.

Would this be a way to go ? If it is, how could this be implemented ?
And do you have any other advice ?

Thanks !

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Efficient iterative shepherd service development ?
  2024-08-05  4:06 Efficient iterative shepherd service development ? Nicolas Odermatt-Lemay
@ 2024-08-05 18:36 ` Felix Lechner via
  2024-08-07  9:05 ` Carlo Zancanaro
  1 sibling, 0 replies; 3+ messages in thread
From: Felix Lechner via @ 2024-08-05 18:36 UTC (permalink / raw)
  To: Nicolas Odermatt-Lemay, help-guix

Hi Nicholas,

On Mon, Aug 05 2024, Nicolas Odermatt-Lemay wrote:

> So I'd like to know the "Guix way", or just a more efficient way to do
> this type of development.

I'd use the Shepherd REPL. [1]

You'll have to install the executables you need into the system profile,
since their store paths may not be known inside the REPL.

Kind regards
Felix

[1] https://www.gnu.org/software/shepherd/manual/html_node/REPL-Service.html


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Efficient iterative shepherd service development ?
  2024-08-05  4:06 Efficient iterative shepherd service development ? Nicolas Odermatt-Lemay
  2024-08-05 18:36 ` Felix Lechner via
@ 2024-08-07  9:05 ` Carlo Zancanaro
  1 sibling, 0 replies; 3+ messages in thread
From: Carlo Zancanaro @ 2024-08-07  9:05 UTC (permalink / raw)
  To: Nicolas Odermatt-Lemay; +Cc: help-guix

On Mon, Aug 05 2024, Nicolas Odermatt-Lemay wrote:
> Would this be a way to go ? If it is, how could this be implemented ?
> And do you have any other advice ?

When I work on services I usually use "guix system vm" and/or "guix
system container". These allow me to instantiate a system with the
service(s) that I'm working on without risking breaking my real system.
It also makes cleaning up between tests much simpler: I just kill the
VM/container.

I find it easier to write a minimal operating-system definition, rather
than using one of my real system definitions, but you can do it either
way.

Carlo


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-07  9:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-05  4:06 Efficient iterative shepherd service development ? Nicolas Odermatt-Lemay
2024-08-05 18:36 ` Felix Lechner via
2024-08-07  9:05 ` Carlo Zancanaro

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.