Hi Carlo,
Thank you! I will try it out.
Chris
On 2024-01-31 16:51, Carlo Zancanaro wrote:
Hi Christopher,
On Tue, Jan 30 2024, Christopher Chmielewski wrote:
So my question is more general. How do you provide config files for
software that expects it to be located in /etc? Is there a best
practice?
On a Guix system, you can do this by extending etc-service-type, which
writes files to /etc.
If you add the following to your operating-system's services then it
should create a file in /etc/clamav/freshclam.conf with the contents
"config goes here".
(simple-service 'freshclam-config etc-service-type
`(("clamav/freshclam.conf" ,(plain-file "freshclam.conf" "config goes
here"))))
If you already have a file that you'd like to use as the config file,
you could instead use local-file with an appropriate path:
(simple-service 'freshclam-config etc-service-type
`(("clamav/freshclam.conf" ,(local-file "path/to/freshclam.conf"))))
These things are also documented in the manual, if you'd like to read
more. See "(guix) Service Reference" for etc-service-type and
simple-service, and "(guix) G-Expressions" for local-file and
plain-file.
The above is for defining this sort of configuration in an "ad-hoc" way:
directly managing the files in /etc. A "better" approach is to define a
Guix system service to manage the configuration. This is more involved,
though, so I wouldn't recommend it to solve your immediate problem. You
can read more about this in the manual under "(guix) Defining Services".
I hope that helps,
Carlo