Hi Daniel,

Daniel Hatton <[email protected]> writes:

> On 16/07/2025 10:08, Steve George wrote:
>
>> In this case I would use Guix Home to copy a ~/.Xresources file in and not 
>> worry about configuring > X if it works for you.
>
> Thanks.  That means I have to write something in a *.scm file to import 
> my .Xresources, right?  The syntax of *.scm files looks a lot harder and 
> more unforgiving than writing the .Xresources, so I think I'll leave 
> that for a day when I'm feeling stronger.

It's not as complicated as it sounds.  The manual [0] shows you how to
setup a simple service that writes configuration to a file in the store
using `plain-file` [1] then uses
`home-xdg-configuration-files-service-type` [2] to put it in the xdg
configuration directory — usually that's ~/.config.  Which is close to
what you want.

The services you want to use is `home-files-service-type` [2].  That
will put files relative to your home directory.  While you could use
`plain-file` there's also `local-file` [1], which takes a file relative
to your .scm file and copies that to the store — where
`home-files-service-type` then can symlink it to the right location.
That way you can write your .Xresources as normal.

It will look something like this:
```
(use-modules (gnu home)
             (gnu home services)
             (gnu services)
             (guix gexp))


(home-environment
       ;; …
       (services
        (append (list
                 ;; …
                 (simple-service 'Xresources
                                 home-files-service-type
                                 (list `(".Xresources"
                                         ,(local-file ".Xresources")))))
                %base-home-services)))
```

Where `.Xresources` is in the same directory as this scheme file.

Note: untested code so there might be a module missing or something.

I hope that helps.

[0] 
https://guix.gnu.org/manual/devel/en/html_node/Declaring-the-Home-Environment.html
[1] 
https://guix.gnu.org/manual/en/html_node/G_002dExpressions.html#index-_0023_007eexp
[2] https://guix.gnu.org/manual/devel/en/html_node/Essential-Home-Services.html

-- 
s/Fred[re]+i[ck]+/Fredrik/g

Reply via email to