mkBinaryCache: support different compression methods: xz (default), zstd, none

This commit is contained in:
thomasjm
2025-01-05 00:24:37 -08:00
committed by Tom McLaughlin
parent 2f5bd177a3
commit 00a218abb2
6 changed files with 82 additions and 24 deletions

View File

@@ -1,8 +1,10 @@
{ compression, ... }@args:
import ./make-test-python.nix (
{ lib, pkgs, ... }:
{
name = "binary-cache";
name = "binary-cache-" + compression;
meta.maintainers = with lib.maintainers; [ thomasjm ];
nodes.machine =
@@ -24,7 +26,12 @@ import ./make-test-python.nix (
nativeBuildInputs = [ openssl ];
}
''
tar -czf tmp.tar.gz -C "${mkBinaryCache { rootPaths = [ hello ]; }}" .
tar -czf tmp.tar.gz -C "${
mkBinaryCache {
rootPaths = [ hello ];
inherit compression;
}
}" .
openssl enc -aes-256-cbc -salt -in tmp.tar.gz -out $out -k mysecretpassword
'';
@@ -78,4 +85,4 @@ import ./make-test-python.nix (
machine.succeed("[ -d %s ] || exit 1" % storePath)
'';
}
)
) args