2024-12-06 05:31:10 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, gitUpdater, installShellFiles, stdenv, testers, kopia }:
|
2020-08-01 17:19:33 +00:00
|
|
|
|
2022-02-04 12:16:47 +00:00
|
|
|
buildGoModule rec {
|
2020-08-01 17:19:33 +00:00
|
|
|
pname = "kopia";
|
2024-11-21 08:54:45 +00:00
|
|
|
version = "0.18.2";
|
2020-08-01 17:19:33 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = pname;
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-11-21 08:54:45 +00:00
|
|
|
hash = "sha256-7gQlBLmHvqsXXmSYllfsDJRx9VjW0AH7bXf6cG6lGOI=";
|
2020-08-01 17:19:33 +00:00
|
|
|
};
|
|
|
|
|
2024-11-21 08:54:45 +00:00
|
|
|
vendorHash = "sha256-lCUEL7rtnv8/86ZTHM4HsYplDnWj1xsFh83JKW6qRrk=";
|
2020-08-04 00:26:27 +00:00
|
|
|
|
2020-08-01 17:19:33 +00:00
|
|
|
subPackages = [ "." ];
|
|
|
|
|
2021-08-26 06:45:51 +00:00
|
|
|
ldflags = [
|
|
|
|
"-X github.com/kopia/kopia/repo.BuildVersion=${version}"
|
|
|
|
"-X github.com/kopia/kopia/repo.BuildInfo=${src.rev}"
|
|
|
|
];
|
2020-08-16 21:04:50 +00:00
|
|
|
|
2024-12-06 05:31:10 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
|
|
installShellCompletion --cmd kopia \
|
|
|
|
--bash <($out/bin/kopia --completion-script-bash) \
|
|
|
|
--zsh <($out/bin/kopia --completion-script-zsh)
|
|
|
|
'';
|
|
|
|
|
2024-08-24 05:31:46 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = gitUpdater { rev-prefix = "v"; };
|
|
|
|
tests = {
|
|
|
|
kopia-version = testers.testVersion {
|
|
|
|
package = kopia;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-08-01 17:19:33 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://kopia.io";
|
|
|
|
description = "Cross-platform backup tool with fast, incremental backups, client-side end-to-end encryption, compression and data deduplication";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "kopia";
|
2020-08-01 17:19:33 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = [ maintainers.bbigras ];
|
|
|
|
};
|
|
|
|
}
|