From: Carlo Zancanaro <carlo@zancanaro.id.au>
To: Christopher Chmielewski <christopherchmielewski@fastmail.com>
Cc: help-guix@gnu.org
Subject: Re: clamav freshclam - how to provide /etc config in general
Date: Thu, 01 Feb 2024 08:51:15 +1100 [thread overview]
Message-ID: <87fryd41f0.fsf@zancanaro.id.au> (raw)
In-Reply-To: <8b6b7b1b-a4d6-4213-b33d-57a04bba4c96@fastmail.com> (Christopher Chmielewski's message of "Tue, 30 Jan 2024 23:13:07 -0500")
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
next prev parent reply other threads:[~2024-01-31 21:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-31 4:13 clamav freshclam - how to provide /etc config in general Christopher Chmielewski
2024-01-31 21:51 ` Carlo Zancanaro [this message]
2024-02-02 0:18 ` Christopher Chmielewski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fryd41f0.fsf@zancanaro.id.au \
--to=carlo@zancanaro.id.au \
--cc=christopherchmielewski@fastmail.com \
--cc=help-guix@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.