nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 buildGoModule,
5 fetchFromGitHub,
6 installShellFiles,
7}:
8
9buildGoModule rec {
10 pname = "desync";
11 version = "1.0.0";
12
13 src = fetchFromGitHub {
14 owner = "folbricht";
15 repo = "desync";
16 tag = "v${version}";
17 hash = "sha256-aRxWq9gGfglfBixS7xOoj8r29rJRAfGj4ydcSFf/7P0=";
18 };
19
20 vendorHash = "sha256-ywID0txn7L6+QkYNvGvO5DTsDQBZLU+pGwNd3q7kLKI=";
21
22 nativeBuildInputs = [ installShellFiles ];
23
24 # nix builder doesn't have access to test data; tests fail for reasons unrelated to binary being bad.
25 doCheck = false;
26
27 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
28 installShellCompletion --cmd desync \
29 --bash <($out/bin/desync completion bash) \
30 --fish <($out/bin/desync completion fish) \
31 --zsh <($out/bin/desync completion zsh)
32
33 mkdir -p $out/share/man/man1
34 $out/bin/desync manpage --section 1 $out/share/man/man1
35 '';
36
37 meta = {
38 description = "Content-addressed binary distribution system";
39 mainProgram = "desync";
40 longDescription = "An alternate implementation of the casync protocol and storage mechanism with a focus on production-readiness";
41 homepage = "https://github.com/folbricht/desync";
42 changelog = "https://github.com/folbricht/desync/releases/tag/v${version}";
43 license = lib.licenses.bsd3;
44 maintainers = with lib.maintainers; [ chaduffy ];
45 };
46}