Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
61 lines
1.5 KiB
Nix
61 lines
1.5 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
python3Packages,
|
|
fetchFromGitHub,
|
|
lz4,
|
|
}:
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
pname = "zfs_replicate";
|
|
version = "4.0.0";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "alunduil";
|
|
repo = "zfs-replicate";
|
|
tag = "v${version}";
|
|
hash = "sha256-VajMSoFZ4SQXpuF1Lo6S9IhxvspCfUwpNw5zg16uA3M=";
|
|
};
|
|
|
|
# For compression to work, both local and remote systems must have lz4 installed.
|
|
# This hard codes the path to the lz4 binary when running it on the local system.
|
|
postPatch = ''
|
|
substituteInPlace zfs/replicate/compress/command.py \
|
|
--replace-fail \
|
|
'("/usr/bin/env - lz4 | ", "/usr/bin/env - lz4 -d | ")' \
|
|
'("${lib.getExe lz4} | ", "/usr/bin/env - lz4 -d | ")'
|
|
'';
|
|
|
|
build-system = with python3Packages; [
|
|
poetry-core
|
|
];
|
|
|
|
dependencies = with python3Packages; [
|
|
click
|
|
stringcase
|
|
];
|
|
|
|
nativeCheckInputs = with python3Packages; [
|
|
hypothesis
|
|
pytest-cov-stub
|
|
pytestCheckHook
|
|
];
|
|
|
|
doCheck = true;
|
|
|
|
disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
|
|
# AssertionError: Expected SystemExit or FileNotFoundError
|
|
"zfs_test/replicate_test/cli_test/main_test.py"
|
|
];
|
|
|
|
meta = {
|
|
description = "ZFS Snapshot Replication";
|
|
homepage = "https://github.com/alunduil/zfs-replicate";
|
|
changelog = "https://github.com/alunduil/zfs-replicate/blob/v${version}/CHANGELOG.md";
|
|
mainProgram = "zfs-replicate";
|
|
license = lib.licenses.bsd2;
|
|
maintainers = with lib.maintainers; [ alunduil ];
|
|
};
|
|
}
|