diff --git a/tests/clamav.nix b/tests/clamav.nix index 434b196..955d1ac 100644 --- a/tests/clamav.nix +++ b/tests/clamav.nix @@ -19,17 +19,15 @@ import { nodes = { server = { config, pkgs, lib, ... }: let - clamav-db-files = lib.mapAttrs (name: value: pkgs.stdenv.mkDerivation rec { - inherit name; - - src = pkgs.fetchurl { - url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/raw/master/tests/clamav/${name}"; - sha256 = value; - }; - - unpackPhase = "true"; # don't try to unpack the raw .cvd files - installPhase = "cp $src $out"; - }) (builtins.fromJSON (builtins.readFile ./clamav/hashes.json)); + clamav-db-files = pkgs.stdenv.mkDerivation rec { + name = "clamav-db-files"; + src = lib.cleanSource ./clamav; + dontUnpack = true; + installPhase = '' + mkdir $out + cp -R $src/*.cvd $out/ + ''; + }; in { imports = [ @@ -58,9 +56,9 @@ import { ''; script = '' - cp ${clamav-db-files."bytecode.cvd"} /var/lib/clamav/ - cp ${clamav-db-files."main.cvd"} /var/lib/clamav/ - cp ${clamav-db-files."daily.cvd"} /var/lib/clamav/ + cp ${clamav-db-files}/main.cvd /var/lib/clamav/ + cp ${clamav-db-files}/daily.cvd /var/lib/clamav/ + cp ${clamav-db-files}/bytecode.cvd /var/lib/clamav/ chown clamav:clamav /var/lib/clamav/* '';