unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* clamav freshclam - how to provide /etc config in general
@ 2024-01-31  4:13 Christopher Chmielewski
  2024-01-31 21:51 ` Carlo Zancanaro
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Chmielewski @ 2024-01-31  4:13 UTC (permalink / raw)
  To: help-guix

Hello Guix Hackers :)

I'm new to Guix and I ran into the following error running the freshclam 
command:

ERROR: Can't open/parse the config file /etc/clamav/freshclam.conf

Now I understand that the error is that the config file is not present 
in /etc. However I figure that there is a "guix-way" of providing this 
config file instead of just creating it in /etc (which would be lost on 
reboot).

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?

Thanks,

Chris


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: clamav freshclam - how to provide /etc config in general
  2024-01-31  4:13 clamav freshclam - how to provide /etc config in general Christopher Chmielewski
@ 2024-01-31 21:51 ` Carlo Zancanaro
  2024-02-02  0:18   ` Christopher Chmielewski
  0 siblings, 1 reply; 3+ messages in thread
From: Carlo Zancanaro @ 2024-01-31 21:51 UTC (permalink / raw)
  To: Christopher Chmielewski; +Cc: help-guix

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: clamav freshclam - how to provide /etc config in general
  2024-01-31 21:51 ` Carlo Zancanaro
@ 2024-02-02  0:18   ` Christopher Chmielewski
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Chmielewski @ 2024-02-02  0:18 UTC (permalink / raw)
  To: Carlo Zancanaro; +Cc: help-guix

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-02  0:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-31  4:13 clamav freshclam - how to provide /etc config in general Christopher Chmielewski
2024-01-31 21:51 ` Carlo Zancanaro
2024-02-02  0:18   ` Christopher Chmielewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).