Subject: Re: [bug#77352] [PATCH v2] home: services: define hyprland home service

From: Carmine Margiotta <[email-masked]>
Date: Mon, 31 Mar 2025 22:14:25 +0200

Hello Andrew,
thank you for your patches!

On 3/31/25 03:14, Andrew Wong wrote:
> How will you serialize g-expressions? It seems that they are to be added 
> to the store as scripts with 'program-file', but I can't figure out how 
> to extract the file path from the resulting object; I tried in a REPL, 
> program-file objects cannot be used as strings like this function seems 
> to suggest, and none of the their properties seem to clearly give their 
> location in the store.

As stated in the define-configuration documentation[1], serialization 
procedures should return strings or g-expressions; in case of 
program-file a g-expression that will ungexp to the script's path will 
be returned and the result will be something like:
"exec = /gnu/store/h98yjz6b2rhmxr48c11cy84d3nwf6a7x-exec"

> Also, how are you testing your work? I asked in the IRC channel and they 
> suggested spooling up a VM via 'guix system vm' with an operating-system 
> definition containing the experimental service, but perhaps you have 
> your own method.

This matches my current workflow perfectly. I used to develop this 
service directly in my system configuration, but that wasn’t the best 
way to test this kind of code. Using a VM is actually pretty 
straightforward! If you need anything about that, feel free to ask me.

[1] https://guix.gnu.org/manual/en/html_node/Complex-Configurations.html