[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: clamav freshclam - how to provide /etc config in general

From: Carlo Zancanaro
Subject: Re: clamav freshclam - how to provide /etc config in general
Date: Thu, 01 Feb 2024 08:51:15 +1100
User-agent: Gnus/5.13 (Gnus v5.13)

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 

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

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,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]