about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2022-03-01 11:14:30 +0100
committerGitHub <noreply@github.com>2022-03-01 11:14:30 +0100
commit199d4224e91327fe6785621d655de638a5d97662 (patch)
treea5b529a28386535b05f544eaa5653eab1ec84315 /nixos
parentf756603651ed590a35a37c1b93fca8e46609daf8 (diff)
parent317ca6bb4e8a0be5d7ab150ef896da6a0ab58843 (diff)
downloadnixlib-199d4224e91327fe6785621d655de638a5d97662.tar
nixlib-199d4224e91327fe6785621d655de638a5d97662.tar.gz
nixlib-199d4224e91327fe6785621d655de638a5d97662.tar.bz2
nixlib-199d4224e91327fe6785621d655de638a5d97662.tar.lz
nixlib-199d4224e91327fe6785621d655de638a5d97662.tar.xz
nixlib-199d4224e91327fe6785621d655de638a5d97662.tar.zst
nixlib-199d4224e91327fe6785621d655de638a5d97662.zip
Merge pull request #155207 from rapenne-s/freshclam_when_internet
clamav: start freshclan after network-online target
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/security/clamav.nix9
1 files changed, 4 insertions, 5 deletions
diff --git a/nixos/modules/services/security/clamav.nix b/nixos/modules/services/security/clamav.nix
index 340cbbf02fb4..95a0ad8770e2 100644
--- a/nixos/modules/services/security/clamav.nix
+++ b/nixos/modules/services/security/clamav.nix
@@ -9,7 +9,7 @@ let
   pkg = pkgs.clamav;
 
   toKeyValue = generators.toKeyValue {
-    mkKeyValue = generators.mkKeyValueDefault {} " ";
+    mkKeyValue = generators.mkKeyValueDefault { } " ";
     listsAsDuplicateKeys = true;
   };
 
@@ -30,7 +30,7 @@ in
 
         settings = mkOption {
           type = with types; attrsOf (oneOf [ bool int str (listOf str) ]);
-          default = {};
+          default = { };
           description = ''
             ClamAV configuration. Refer to <link xlink:href="https://linux.die.net/man/5/clamd.conf"/>,
             for details on supported values.
@@ -59,7 +59,7 @@ in
 
         settings = mkOption {
           type = with types; attrsOf (oneOf [ bool int str (listOf str) ]);
-          default = {};
+          default = { };
           description = ''
             freshclam configuration. Refer to <link xlink:href="https://linux.die.net/man/5/freshclam.conf"/>,
             for details on supported values.
@@ -104,7 +104,6 @@ in
     systemd.services.clamav-daemon = mkIf cfg.daemon.enable {
       description = "ClamAV daemon (clamd)";
       after = optional cfg.updater.enable "clamav-freshclam.service";
-      requires = optional cfg.updater.enable "clamav-freshclam.service";
       wantedBy = [ "multi-user.target" ];
       restartTriggers = [ clamdConfigFile ];
 
@@ -134,7 +133,7 @@ in
     systemd.services.clamav-freshclam = mkIf cfg.updater.enable {
       description = "ClamAV virus database updater (freshclam)";
       restartTriggers = [ freshclamConfigFile ];
-
+      after = [ "network-online.target" ];
       preStart = ''
         mkdir -m 0755 -p ${stateDir}
         chown ${clamavUser}:${clamavGroup} ${stateDir}