diff --git a/nix/sources.json b/nix/sources.json index 1dd1601..41ffd61 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -1,4 +1,11 @@ { + "blobs": { + "sha256": "1g687x3b2r4ar5i4xyav5qzpy9fp1phx9wf70f4j3scwny0g7hn1", + "type": "tarball", + "url": "https://gitlab.com/simple-nixos-mailserver/blobs/-/archive/2cccdf1ca48316f2cfd1c9a0017e8de5a7156265/blobs-2cccdf1ca48316f2cfd1c9a0017e8de5a7156265.tar.gz", + "url_template": "https://gitlab.com/simple-nixos-mailserver/blobs/-/archive//blobs-.tar.gz", + "version": "2cccdf1ca48316f2cfd1c9a0017e8de5a7156265" + }, "nixpkgs-20.09": { "branch": "release-20.09", "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to", diff --git a/tests/clamav.nix b/tests/clamav.nix index c641622..f62df58 100644 --- a/tests/clamav.nix +++ b/tests/clamav.nix @@ -21,14 +21,10 @@ pkgs.nixosTest { nodes = { server = { config, pkgs, lib, ... }: let - 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/ - ''; + sources = import ../nix/sources.nix; + blobs = pkgs.fetchzip { + url = sources.blobs.url; + sha256 = sources.blobs.sha256; }; in { @@ -58,9 +54,9 @@ pkgs.nixosTest { ''; script = '' - 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/ + cp ${blobs}/clamav/main.cvd /var/lib/clamav/ + cp ${blobs}/clamav/daily.cvd /var/lib/clamav/ + cp ${blobs}/clamav/bytecode.cvd /var/lib/clamav/ chown clamav:clamav /var/lib/clamav/* ''; diff --git a/tests/clamav/.gitattributes b/tests/clamav/.gitattributes deleted file mode 100644 index 054ac19..0000000 --- a/tests/clamav/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*cvd filter=lfs diff=lfs merge=lfs -text diff --git a/tests/clamav/.gitignore b/tests/clamav/.gitignore deleted file mode 100644 index c5797d6..0000000 --- a/tests/clamav/.gitignore +++ /dev/null @@ -1 +0,0 @@ -mirrors.dat diff --git a/tests/clamav/bytecode.cvd b/tests/clamav/bytecode.cvd deleted file mode 100644 index d3d8682..0000000 Binary files a/tests/clamav/bytecode.cvd and /dev/null differ diff --git a/tests/clamav/daily.cvd b/tests/clamav/daily.cvd deleted file mode 100644 index e3869e3..0000000 Binary files a/tests/clamav/daily.cvd and /dev/null differ diff --git a/tests/clamav/freshclam.conf b/tests/clamav/freshclam.conf deleted file mode 100644 index 3d9ca5f..0000000 --- a/tests/clamav/freshclam.conf +++ /dev/null @@ -1 +0,0 @@ -DatabaseMirror database.clamav.net diff --git a/tests/clamav/hashes.json b/tests/clamav/hashes.json deleted file mode 100644 index 4bcec9e..0000000 --- a/tests/clamav/hashes.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "bytecode.cvd": "633d4f0a2054249e23df12db5a9e76bcaac23cadaef5ee8f644986f600d8d81e", - "daily.cvd": "0b6798b54e490be168b873d39ebda41ff4a027720aed855f879779b88982838f", - "main.cvd": "9694933f37148ec39c1f2ef7b97211ded9b03b140bb48a5eeb27270120844b24" -} diff --git a/tests/clamav/main.cvd b/tests/clamav/main.cvd deleted file mode 100644 index ac4d384..0000000 Binary files a/tests/clamav/main.cvd and /dev/null differ diff --git a/tests/clamav/update-clamav-database.sh b/tests/clamav/update-clamav-database.sh deleted file mode 100755 index 91f1ce1..0000000 --- a/tests/clamav/update-clamav-database.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -set -e - -cd "$(dirname "${0}")" - -rm ./*.cvd hashes.json || : - -freshclam --datadir=. --config-file=freshclam.conf -(for i in ./*.cvd; - do echo '{}' | - jq --arg path "$(basename "${i}")" \ - --arg sha256sum "$(sha256sum "${i}" | awk '{ print $1; }')" \ - '.[$path] = $sha256sum'; done) | - jq -s add > hashes.json