Hi Sébastien,

Correct me if I’m wrong, but it looks like a follow-up on
<https://lists.gnu.org/archive/html/help-guix/2025-06/msg00139.html>, right?


On Sun Jan 4, 2026 at 4:28 AM CET, Sébastien Gendre wrote:
> Today I came across this "Web application package guidelines" for Arch
> Linux. What do you think about it ? Do you think it could be a good
> guideline to follow when packaging a web application for Guix ?

Are you talking about this: 
<https://wiki.archlinux.org/title/Web_application_package_guidelines>?
Thanks. I didn’t know about it.


> For example, we could:
>
> - Define the web app package that install the app code in
>   "/usr/share/$app_name/", owned by root

I might be wrong, but the app code lives in the store and there should
be no reason to expose it anywhere else.


> - Define a system service type that only configure and run the webapp
>
> - Define a full stack system service, that configure and run the webapp,
>   the database, the reverse proxy and/or any other necessary components

This we can already do. I’m not sure if we can figure out a generic way
to do it for all the web app, though; for all the web apps are different.


> The system service type will:
>
> - Generate the config for the app and store it in "/etc/$app_name/"

I’m a big fan of [Twelve-factor app](https://12factor.net/), so I will
find a way for the config to be in the store and be passed using ENV variables.


> This system service type can be made to run one or multiple instances of
> the same app. In this case, in "/etc/$app_name/", a sub directory will
> be created in it for each instance config. And the Shepherd service of
> each instance will be named as "$app_name-$instance_name". But I don't
> know if the multiple instances management should be inside the service type
> logic or if a service type can have multiple instances of itself.

mmm… I would create 1 service per instance.


> - Use "/run/$app_name/" or "/run/$app_name/$instance_name/" as the
>   runtime directory of the application
>
> - Use "/var/cache/$app_name/" or "/var/cache/$app_name/$instance_name/"
>   as the cache directory of the application
>
> - Use "/var/lib/$app_name/" or "/var/lib/$app_name/$instance_name/" as
>   the persistent storage of the application

We should definitively use the proper folders (`/run`, `/var`…), indeed.
That should be documented somewhere and checked during code review.


> What do you think ?

As I said back in june [1], I have no experience with this… yet!
For things have changed!! [2] 🥳

[1]: https://lists.gnu.org/archive/html/help-guix/2025-06/msg00141.html
[2]: https://codeberg.org/guix/guix/pulls/4960

I’ll soon have to deploy few web apps on my Lime2 running Guix System.
I’ll keep you posted… 🤞

Regards,

--
Tanguy

Reply via email to